summaryrefslogtreecommitdiff
path: root/lib/elements/fill_stitch.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-10-22 18:04:41 +0200
committerGitHub <noreply@github.com>2025-10-22 18:04:41 +0200
commitf5a7a2b6358aa767ae65578ff622c9856d78589f (patch)
treef2ba99deca3fbca79d78f9ce1401a42eb189d492 /lib/elements/fill_stitch.py
parent217c7853c88bc3d70d13a71bb72ed57c70881af5 (diff)
Gradient color: fix cache key error (#4007)
* use first stop color for non linear gradient fill objects * fix bug in get_cache_key for gradient objects
Diffstat (limited to 'lib/elements/fill_stitch.py')
-rw-r--r--lib/elements/fill_stitch.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index 7ce3188a..3c871b8e 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -632,7 +632,11 @@ class FillStitch(EmbroideryElement):
@property
def color(self):
- return self.fill_color
+ color = self.fill_color
+ # if color is a gradient, pick the first color
+ if isinstance(color, LinearGradient):
+ color = self._get_color(color.stops[0], "stop-color", "black")
+ return color
@property
def gradient(self):