parse

fun Color.Companion.parse(color: String, customColorSpaces: Map<String, ColorSpace<*>> = emptyMap()): Color

Parse a string representing a CSS color value.

Parameters

color

The CSS color string to parse

customColorSpaces

A list of custom color spaces to recognize in the color() function. Each pair should be the identifier of the color and its ColorSpace.

Throws

if the value cannot be parsed