Skip to content

Commit

Permalink
Issue #140: fix default colors in scheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
enzet committed Aug 17, 2022
1 parent 199dff9 commit afb050c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Unreleased
# 0.1.7

_17 August 2022_

- Redraw diving tower icons.
- Add icons for:
- `shop=car_parts`, `shop=variety_store` (#48),
- `natural=spring` (#55),
- `tomb=pyramid`.
- Reuse icon for `shop=department_store` (#48).
- Redraw fountain icons.
- Fix style for `indoor=room` (#139).
- Redraw diving tower and fountain icons.
- Add `--scheme` option (#140).
- Rename `element` command to `draw` and change format.

# 0.1.6

Expand Down
2 changes: 1 addition & 1 deletion map_machine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__doc_url__ = f"{__url__}/blob/main/README.md"
__author__ = "Sergey Vartanov"
__email__ = "[email protected]"
__version__ = "0.1.6"
__version__ = "0.1.7"

from pathlib import Path

Expand Down
6 changes: 5 additions & 1 deletion map_machine/scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

IconDescription = list[Union[str, dict[str, str]]]

DEFAULT_COLOR: Color = Color("black")


@dataclass
class LineStyle:
Expand Down Expand Up @@ -397,7 +399,9 @@ def get_color(self, color: str) -> Color:
return Color(color)
except (ValueError, AttributeError):
logging.debug(f"Unknown color `{color}`.")
return Color(self.colors["default"])
if "default" in self.colors:
return Color(self.colors["default"])
return DEFAULT_COLOR

def get_default_color(self) -> Color:
"""Get default color for a main icon."""
Expand Down

0 comments on commit afb050c

Please sign in to comment.