rgb2hsv - chung-leong/qb GitHub Wiki
rgb2hsv- Convert color values from RGB color-space to HSV
float[3] rgb2hsv( float[3] $pixel )
float[4] rgb2hsv( float[4] $pixel )
rgb2hsv() converts an array containing RGB values to corresponding values in the Hue-Saturation-Value color-space. It is the inverse of hsv2rgb().
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 HSV values. The return value will have the same length as pixel.
Version
1.4 and above.