From d2e205fcafa50da7125bcb56dfcc3afd3fe73924 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Sat, 8 Jan 2022 23:29:45 +0300 Subject: [PATCH] Issue #102: add preliminary variable processing. --- map_machine/scheme.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/map_machine/scheme.py b/map_machine/scheme.py index acf630e..0138eb8 100644 --- a/map_machine/scheme.py +++ b/map_machine/scheme.py @@ -395,7 +395,15 @@ class Scheme: return Color(color) except (ValueError, AttributeError): logging.debug(f"Unknown color `{color}`.") - return DEFAULT_COLOR + return Color(self.colors["default"]) + + def get(self, variable_name: str): + """ + FIXME: colors should be variables. + """ + if variable_name in self.colors: + return self.colors[variable_name] + return 0.0 def is_no_drawable(self, key: str, value: str) -> bool: """