You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can't use inkscape"s color palette to set custom colors to strokes.
ColorSeparation.py assumes each element's stroke of fill are plain color convertible to RGB, what may not be the case especially when dealing with color palette which use gradients even for plain colors. Even worse: inkscape uses sub-gradient for each elements even if the same color swatch is used (for a matter of gradient positioning):
silhouette_multi.py was called via: ['silhouette_multi.py', '--dry_run=true', '--register_once=true', '--block=true', '--verbose=true', '/tmp/ink_ext_XXXXXX.svgPGC8Z2']
Traceback (most recent call last):
File "silhouette_multi.py", line 316, in <module>
e.run()
File "/usr/share/inkscape/extensions/inkex/base.py", line 250, in run
self.save_raw(self.effect())
File "silhouette_multi.py", line 145, in effect
self.split_objects_by_color()
File "silhouette_multi.py", line 136, in split_objects_by_color
color = self.get_color(obj)
File "silhouette_multi.py", line 99, in get_color
color = Color(color).to_rgb()
File "/usr/share/inkscape/extensions/inkex/colors.py", line 248, in __init__
space, color = self.parse_str(color.strip())
File "/usr/share/inkscape/extensions/inkex/colors.py", line 325, in parse_str
raise ColorIdError("Color references other element id, e.g. a gradient")
inkex.colors.ColorIdError: 'Color references other element id, e.g. a gradient'
Of course the color module can not convert to RGB the string url(#linearGradient8295).
The colors have to be identified by authored string instead, but this leads to a new issue: duplicate color items for each gradient url even the underlaying sub-gradient is the same color swatch... :(
The text was updated successfully, but these errors were encountered:
Maybe the solution is to search for the last gradient of the chain (the one with no xlink:href attribute and some color stops) to get an ID identifier for the color...
Exemple with SVG fragment above:
path1952 have fill: url(#linearGradient8283) > get linearGradient8283, it have a xlink:href=#black > get #black, it have no xlink >>> use this string as color ID, and extract 1st color stop's color to get the RGB
the second path1954 will lead to the same #black gradient...
devingfx
changed the title
Multi Action's ColorSeparation.py doen's support colors from pallette
Multi Action's ColorSeparation.py doesn't support colors from pallette
Jan 21, 2025
We can't use inkscape"s color palette to set custom colors to strokes.
ColorSeparation.py assumes each element's stroke of fill are plain color convertible to RGB, what may not be the case especially when dealing with color palette which use gradients even for plain colors. Even worse: inkscape uses sub-gradient for each elements even if the same color swatch is used (for a matter of gradient positioning):
Of course the color module can not convert to RGB the string
url(#linearGradient8295)
.The colors have to be identified by authored string instead, but this leads to a new issue: duplicate color items for each gradient url even the underlaying sub-gradient is the same color swatch... :(
The text was updated successfully, but these errors were encountered: