Declaration

func transformColors(_ block: @escaping (NSColor) -> NSColor)

Declaration

- (void) transformColorsUsingBlock:(NSColor * (^)(NSColor *)) block;

Declaration

transformColorsUsingBlock_(: NSColor, block)

Parameters

block

The 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