summaryrefslogtreecommitdiff
path: root/lib/extensions/generate_palette.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-06-30 22:49:18 +0200
committerGitHub <noreply@github.com>2024-06-30 22:49:18 +0200
commite52886a64a4e76c3fdc49df95c85655da3c4f7f4 (patch)
tree88a4edee630df0947553ced79fb6eb9dc510ccea /lib/extensions/generate_palette.py
parent7c06dee44ac7951a5db406eb829100a5bc3e5887 (diff)
Various fixes (#3028)
* several thread palette extension fixes * fix svg tartan when original shape is invalid * tartan stroke spaces * style * fix tartan color substituion at pattern start * ripple: do not render too small paths * use less space for params warning headline * fix clone shape path * zip export template fix (typo) * add realistic stitch plan output warning (help tab)
Diffstat (limited to 'lib/extensions/generate_palette.py')
-rw-r--r--lib/extensions/generate_palette.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/extensions/generate_palette.py b/lib/extensions/generate_palette.py
index f5d7661c..b87bc179 100644
--- a/lib/extensions/generate_palette.py
+++ b/lib/extensions/generate_palette.py
@@ -62,7 +62,10 @@ class GeneratePalette(InkstitchExtension):
def _get_color_from_elements(self, elements):
colors = []
for element in elements:
- if 'fill' not in element.style.keys() or not isinstance(element, inkex.TextElement): # type(element) != inkex.TextElement:
+ if element.TAG == 'g':
+ colors.extend(self._get_color_from_elements(element.getchildren()))
+ continue
+ if 'fill' not in element.style.keys() or not isinstance(element, inkex.TextElement):
continue
color = inkex.Color(element.style['fill']).to_rgb()