How can I get (and set) the glyph color via scripting?
I’m trying (from Glyphs.app Python Scripting API Documentation) the following code and it doesn’t work:
glyph = Glyphs.font['dollar']
# use glyph color to draw the outline
glyph.colorObject.set()
print(glyph)
# Get RGB (and alpha) values (as float numbers 0..1, multiply with 256 if necessary)
R, G, B, A = glyph.colorObject.colorUsingColorSpace_(NSColorSpace.genericRGBColorSpace()).getRed_green_blue_alpha_(None, None, None, None)
print(R, G, B)
Do you mean filter for all glyphs that have a color or for specific RGB values?
The later us abut difficult as there is not UI for colors in the filter UI. And exactly matching colors might be tricky because if the different representations and profiles.