rgb2hsl - chung-leong/qb GitHub Wiki
rgb2hsl- Convert color values from RGB color-space to HSL
float[3] rgb2hsl( float[3] $pixel )
float[4] rgb2hsl( float[4] $pixel )
rgb2hsl() converts an array containing RGB values to corresponding values in the Hue-Saturation-Lightness color-space. It is the inverse of hsl2rgb().
The range of hue is 0 to 360, while saturation and lightness vary from 0 to 1. If red, green, blue are the same (i.e. the pixel is grey), hue will be set to 0.
Parameters:
pixel - The RGB values to convert. It can be a single three or four-element array or an array of such arrays.
Return Value:
An array containing HSL values. The return value will have the same length as pixel.
Version
1.4 and above.