I need to pass from RGB color space to HSV .. I searched in internet and found two different implementations, but those give me different results:
A:
I don't have a development environment to check, but you can use wolframAlpha to build up some asserts.
For Instance: rgb(1,0,0)(pure red) to hsv is 0, 100%, 100% in hsv.