set_luminance(color, luminance, space='hcl')[source]

Return a color with a different luminance and the same hue and saturation as the input color.

  • color (color-spec) – The color. Sanitized with to_rgba.

  • luminance (float, optional) – The new luminance. Should lie between 0 and 100.

  • space ({'hcl', 'hpl', 'hsl', 'hsv'}, optional) – The hue-saturation-luminance-like colorspace used to transform the color. Default is the strictly perceptually uniform colorspace 'hcl'.


color (str) – An 8-digit HEX string indicating the red, green, blue, and alpha channel values.