PyNGL Home > Functions > Color routines


Converts from the HLS color space to RGB.


r, g, b = Ngl.hlsrgb(h, l, s)



Hue values in the range [0.,360.). A hue of "0." corresponds to blue.


Lightness values in the range [0.,100.]. Lightness is a measure of the quantity of light - a lightness of 0. is black, and a lightness of 100. gives white. The pure hues occur at lightness value 50.


Saturation values in the range [0.,100.]. Saturation is a measure of how much white light is mixed with the color. Colors having a saturation value of 0. represent grays with a gray intensity value equal to the lightness L. Colors with a saturation value of 100. are fully saturated colors. The hue is undefined when S=0. The fully saturated pure hues occur when S=100. and L=50.

Return values

r, g, b

The red, green, and blue intensity values in the range [0., 1.].


This function converts from the HLS (Hue, Lightness, Saturation) color space to the RGB (Red, Green, Blue) color space.

See Also

Ngl.hsvrgb, Ngl.rgbhls, Ngl.rgbhsv, Ngl.rgbyiq, Ngl.yiqrgb


For an example, see the test in