From 1b45f3489f588a548ab959e9fd0ac04a5e8af4c5 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Sun, 13 Jun 2021 01:59:34 +0300 Subject: [PATCH] Add outline parameter for shape. --- roentgen/icon.py | 11 +++++++++-- scheme/default.yml | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/roentgen/icon.py b/roentgen/icon.py index e8118fa..f02ac1b 100644 --- a/roentgen/icon.py +++ b/roentgen/icon.py @@ -195,6 +195,7 @@ class ShapeSpecification: offset: np.array = np.array((0, 0)) flip_horizontally: bool = False flip_vertically: bool = False + use_outline: bool = True @classmethod def from_structure( @@ -214,6 +215,7 @@ class ShapeSpecification: offset: np.array = np.array((0, 0)) flip_horizontally: bool = False flip_vertically: bool = False + use_outline: bool = True if isinstance(structure, str): shape = extractor.get_shape(structure) @@ -230,8 +232,13 @@ class ShapeSpecification: flip_horizontally = structure["flip_horizontally"] if "flip_vertically" in structure: flip_vertically = structure["flip_vertically"] + if "outline" in structure: + use_outline = structure["outline"] - return cls(shape, color, offset, flip_horizontally, flip_vertically) + return cls( + shape, color, offset, flip_horizontally, flip_vertically, + use_outline + ) def is_default(self) -> bool: """ @@ -264,7 +271,7 @@ class ShapeSpecification: path = self.shape.get_path(svg, point, self.offset, scale) path.update({"fill": self.color.hex}) - if outline: + if outline and self.use_outline: bright: bool = is_bright(self.color) color: Color = Color("black") if bright else Color("white") opacity: float = 0.7 if bright else 0.5 diff --git a/scheme/default.yml b/scheme/default.yml index a92a237..68e8c5e 100644 --- a/scheme/default.yml +++ b/scheme/default.yml @@ -20,6 +20,7 @@ colors: evergreen_color: "#688C44" farmland_color: "#FFEEBB" farmland_border_color: "#DDCC99" + farmland_darker_color: "#998855" ferry_terminal_color: "#AABBDD" foot_border_color: "#FFFFFF" foot_color: "#B89A74" @@ -144,7 +145,7 @@ node_icons: - tags: {plant: christmas_trees} shapes: [{shape: christmas_tree, color: orchard_border_color}] - tags: {crop: sunflower} - shapes: [{shape: sunflower, color: farmland_border_color}] + shapes: [{shape: sunflower, color: farmland_darker_color, outline: no}] - tags: {produce: apple} shapes: [{shape: apple, color: orchard_border_color}] - tags: {produce: christmas_trees}