h , s , v = hue , saturation , value double cmax = Math . Max ( r , Math . Max ( g , b ) ) ; maximum of r , g , b double cmin = Math . Min ( r , Math . Min ( g , b ) ) ; minimum of r , g , b double diff = cmax - cmin ; diff of cmax and cmin .
double h = - 1 , s = - 1 ;