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
I want to mark glyphs with a specific color and later I want to find the glyphs which are marked with that color. But as illustrated above, this does not work as expected. I suspect the root of the problem is in the "stringification" of the defcon Color object, which rounds the color components to 5 decimal places. Therefore the assigned value does not equal the value which stored in the object and equality test with the assigned value fails.
The text was updated successfully, but these errors were encountered:
If you want to look up the color afterwards for example for sorting glyphs it is best to compare mark colors with Color objects:
fromdefconimportGlyph, Color# create a colorc=Color((1, 1, .123456789, .3))
# create a glyphglyph=Glyph()
# set a mark colorglyph.markColor=c# compareprint(glyph.markColor==c)
print(glyph.markColor==Color((1, 1, .123456789, .3))
Hello,
I try to work with named colors as used in HTML/CSS. My problem ist best shown in the following sample script:
I want to mark glyphs with a specific color and later I want to find the glyphs which are marked with that color. But as illustrated above, this does not work as expected. I suspect the root of the problem is in the "stringification" of the defcon Color object, which rounds the color components to 5 decimal places. Therefore the assigned value does not equal the value which stored in the object and equality test with the assigned value fails.
The text was updated successfully, but these errors were encountered: