I can convert RGB values to HSV with the following code...
$r = $r/255; $g = $g/255; $b = $b/255; $h = 0; $s = 0; $v
ColorJizz allows you to convert from/to many formats. There is a PHP version too.