Skip to content

Commit

Permalink
Issue #121: fix colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
enzet committed Apr 7, 2022
1 parent 438500f commit 6d31807
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions map_machine/scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ def get_icon(
main_icon: Optional[Icon] = None
extra_icons: list[Icon] = []
priority: int = 0
color: Optional[Color] = None

for index, matcher in enumerate(self.node_matchers):
if not matcher.replace_shapes and main_icon:
Expand Down Expand Up @@ -535,12 +536,11 @@ def get_icon(
extra_icons += [Icon(specifications)]
processed |= matcher_tags
if matcher.set_main_color and main_icon:
main_icon.recolor(self.get_color(matcher.set_main_color))
color = self.get_color(matcher.set_main_color)
main_icon.recolor(color)
if matcher.set_opacity and main_icon:
main_icon.opacity = matcher.set_opacity

color: Optional[Color] = None

if "material" in tags:
value: str = tags["material"]
if value in self.material_colors:
Expand Down Expand Up @@ -570,7 +570,7 @@ def get_icon(
if configuration.show_overlapped:
small_dot_spec: ShapeSpecification = ShapeSpecification(
extractor.get_shape(DEFAULT_SMALL_SHAPE_ID),
self.get_color("default"),
color if color else self.get_color("default"),
)
default_icon = Icon([small_dot_spec])

Expand Down

0 comments on commit 6d31807

Please sign in to comment.