color

val String.color: <Error class: unknown class>

Parses any supported CSS color string into a Color.

Accepts hex, rgb(), rgba(), hsl()/hsla(), lab(), oklch(), color(srgb …) / color(srgb-linear …), or any of the 140 CSS named colors. Goes through the same grammar the JSON decoder uses, so "red".color and the value decoded from spec JSON are identical.

Receiver

the CSS color string to parse.

Return

the parsed Color.