Convert RGB (Red/Green/Blue) to a HSV (Hue/Saturation/Lightness) | + PHP Code

Here’s a recent code i did for converting RGB (Red/Green/Blue) color value to a HSV (Hue/Saturation/Lightness) color value in PHP. The code renders accurate results for all the color codes except for #ffffff(white) and #000000 (black).

Yeah I know I am too lazy(or busy) to fix this bug now.. but this is a minor thing which i will soon do and re update.

First for a demo: