Instance Method
transformColors(_:)transformColorsUsingBlock:transformColorsUsingBlock_
Passes each document color to the given block and updates it if the block returns a new color.
Declaration
func transformColors(_ block: @escaping (NSColor) -> NSColor)Declaration
- (void) transformColorsUsingBlock:(NSColor * (^)(NSColor *)) block;Declaration
transformColorsUsingBlock_(: NSColor, block)Parameters
blockThe block that receives each document color and returns the replacement color.
Discussion
Only colors affecting exported artifacts, like the fill color of a shape on a color layer, are processed by this method. Colors purely for internal use, like a label color of a glyph, are not affected.
Palette colors (GSPaletteColor) are also passed to the block. However, in most cases these do not need to be processed as they reference colors in the color palettes of the font. (The colors of these palettes are passed to the block.)
Return the original color object to not update a color.
See Also
Colors
The RGB color space used by document colors in the font.
Changes the color space used by document colors in the font.
Returns the given color converted to match the color space of the font.