Skip to main content

parse_color_value

Parse the color value provided and return a number between 0 and 1.

def parse_color_value(
value: int | str,
max_val: int = 255
) - > float

Parse the color value provided and return a number between 0 and 1.

Parameters

NameTypeDescription
value`intstr`
max_valint = 255Maximum range value. Defaults to 255.

Returns

TypeDescription
floatA number between 0 and 1.