Skip to main content

parse_hsl

Parse raw hue, saturation, lightness, and alpha values and convert to RGBA.

def parse_hsl(
h: str,
h_units: str,
sat: str,
light: str,
alpha: float | None = None
) - > RGBA

Parse raw hue, saturation, lightness, and alpha values and convert to RGBA.

Parameters

NameTypeDescription
hstrThe raw hue value to be converted.
h_unitsstrThe unit of measurement for the hue value, such as 'deg', 'rad', or 'turns'.
satstrThe saturation percentage value.
lightstrThe lightness percentage value.
alpha`floatNone` = None

Returns

TypeDescription
RGBAAn instance of RGBA containing the converted color components and the parsed alpha transparency.