mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-06 10:09:52 +02:00
Fix icon color in grid.
This commit is contained in:
parent
792922fd86
commit
2b601b94a6
3 changed files with 4 additions and 2 deletions
BIN
doc/grid.png
BIN
doc/grid.png
Binary file not shown.
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
|
@ -46,6 +46,7 @@ def draw_all_icons(
|
||||||
for x in element[key]
|
for x in element[key]
|
||||||
]
|
]
|
||||||
icon: Icon = Icon(specifications)
|
icon: Icon = Icon(specifications)
|
||||||
|
icon.recolor(Color("#444444"), exclude=Color("white"))
|
||||||
if icon not in icons:
|
if icon not in icons:
|
||||||
icons.append(icon)
|
icons.append(icon)
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -284,12 +284,13 @@ class Icon:
|
||||||
"""
|
"""
|
||||||
return self.shape_specifications[0].is_default()
|
return self.shape_specifications[0].is_default()
|
||||||
|
|
||||||
def recolor(self, color: Color) -> None:
|
def recolor(self, color: Color, exclude: Optional[Color] = None) -> None:
|
||||||
"""
|
"""
|
||||||
Paint all shapes in the color.
|
Paint all shapes in the color.
|
||||||
"""
|
"""
|
||||||
for shape_specification in self.shape_specifications:
|
for shape_specification in self.shape_specifications:
|
||||||
shape_specification.color = color
|
if not exclude or shape_specification.color != exclude:
|
||||||
|
shape_specification.color = color
|
||||||
|
|
||||||
def add_specifications(
|
def add_specifications(
|
||||||
self, specifications: List[ShapeSpecification]
|
self, specifications: List[ShapeSpecification]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue