diff options
| author | George Steel <george.steel@gmail.com> | 2023-01-07 19:27:35 -0500 |
|---|---|---|
| committer | George Steel <george.steel@gmail.com> | 2023-01-07 19:27:35 -0500 |
| commit | f69bd1654ae344b0f81f2caea6ef58846eb6e866 (patch) | |
| tree | 8392ef0900ad8308a9819654cf6f5c0f8f40ab61 /lib/elements | |
| parent | d416407f2bb447a655266ae926337be853e88217 (diff) | |
| parent | a7b2122d91703d72177cf980cecbef8fca3d54ec (diff) | |
Merge branch 'main' of https://github.com/inkstitch/inkstitch into george-steel/random-base-satin
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/stroke.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index 6bd6a54a..a95edf70 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -18,6 +18,7 @@ from ..svg import get_node_transform, parse_length_with_units from ..utils import Point, cache from .element import EmbroideryElement, param from .validation import ValidationWarning +from ..threads import ThreadColor warned_about_legacy_running_stitch = False @@ -57,7 +58,17 @@ class Stroke(EmbroideryElement): @property def color(self): - return self.get_style("stroke") + color = self.get_style("stroke") + if self.cutwork_needle is not None: + color = ThreadColor(color, description=self.cutwork_needle, chart=self.cutwork_needle) + return color + + @property + def cutwork_needle(self): + needle = self.get_int_param('cutwork_needle') or None + if needle is not None: + needle = f'Cut {needle}' + return needle @property def dashed(self): |
