31 array<double, 3> Rgb2Hsv(
double r,
double g,
double b)
33 array<double, 3> ret_val {{0.0, 0.0, 0.0}};
34 const auto mini = min( r, min(g, b) );
35 const auto maxi = max( r, max(g, b) );
36 const auto delta = maxi - mini;
40 const auto s = delta / maxi;
44 h = ( g - b ) / delta;
45 }
else if( g == maxi ) {
46 h = 2.0 + ( b - r ) / delta;
48 h = 4.0 + ( r - g ) / delta;
54 ret_val = {{ h, s, v}};
56 ret_val = {{-1.0, 0.0, 0.0}};
Rgb color def to Hsv color def: r,g,b values are from 0 to 1 and h = [0,360], s = [0...
Namespace for the core simulator.