set_luminance¶
- set_luminance(color, luminance, space='hcl')[source]¶
Return a color with a different luminance and the same hue and saturation as the input color.
- Parameters
color (
color-spec
) – The color. Sanitized withto_rgba
.luminance (
float
, optional) – The new luminance. Should lie between0
and100
.space (
{'hcl', 'hpl', 'hsl', 'hsv'}
, optional) – The hue-saturation-luminance-like colorspace used to transform the color. Default is the perceptually uniform colorspace'hcl'
.
- Returns
color (
str
) – An 8-digit HEX string indicating the red, green, blue, and alpha channel values.
See also
set_hue
,set_saturation
,set_alpha
,shift_hue
,scale_saturation
,scale_luminance