Function RGBtoHSV (o2scl)¶
-
void o2scl::RGBtoHSV(double r, double g, double b, double &h, double &s, double &v)¶
Convert RGB to HSV color.
Taken from Nathan Schaller’s webpage at http://www.cs.rit.edu/~ncs/color/t_convert.html
The inputs should be in the ranges \( h \in [0,360] \), \( s \in [0,1] \), and \( v \in [0,1] \). The output values
r
,g
, andb
are \( \in [0,1] \).If s == 0, then h = -1 (undefined)