Fix background color function.

This commit is contained in:
Sergey Vartanov 2021-11-18 07:45:30 +03:00
parent 8aa06c7d70
commit 1197a60bac
2 changed files with 4 additions and 3 deletions

View file

@ -79,7 +79,8 @@ class MapConfiguration:
"""Whether drawing mode is special.""" """Whether drawing mode is special."""
return self.drawing_mode != DrawingMode.NORMAL return self.drawing_mode != DrawingMode.NORMAL
def backghround_color(self) -> Optional[Color]: def background_color(self) -> Optional[Color]:
"""Get background map color based on drawing mode."""
if self.drawing_mode not in (DrawingMode.NORMAL, DrawingMode.BLACK): if self.drawing_mode not in (DrawingMode.NORMAL, DrawingMode.BLACK):
return Color("#111111") return Color("#111111")
return None return None

View file

@ -48,8 +48,8 @@ class Map:
self.configuration = configuration self.configuration = configuration
self.background_color: Color = self.scheme.get_color("background_color") self.background_color: Color = self.scheme.get_color("background_color")
if self.configuration.backghround_color(): if color := self.configuration.background_color():
self.background_color = self.configuration.backghround_color() self.background_color = color
def draw(self, constructor: Constructor) -> None: def draw(self, constructor: Constructor) -> None:
"""Draw map.""" """Draw map."""