parseOrNull

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

Parse a string representing a CSS color value, or return null if the string isn't in a recognized format.

Parameters

color

The 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.