from_string method

from_string

Parses string containing the CSS color and returns a new Color.

Returns

A new instance of the Color class

def from_string(self, color):
    ...
ParameterTypeDescription
colorstrA string containing the color in the format RGB, HEX, HSL, HSV, HWB, CMYK, NCOL, LCH, OKLCH, LAB or OKLAB

See Also