parseColors

external fun parseColors(svg: SVG, options: ParseColorsOptions? = definedExternally): FindColorsResult

Find and optionally replace colors in an SVG.

Checks color attributes, inline and global styles and animated color values. For each color, ParseColorsOptions.callback can return a new color to change it, the original value to keep it, "unset" to delete the value, or "remove" to remove the shape or rule. ParseColorsOptions.defaultColor is applied to shapes that rely on the default black fill; it can be a color or a callback.

Returns the list of found colors and whether the icon relies on a default color or global style. Clean up the SVG first (for example with cleanupSVG) so styles are converted to attributes before parsing, otherwise results might be inaccurate.