this.h = h;\r
this.s = s;\r
this.v = v;\r
- updateRGB(); \r
+ updateRGB(); \r
}\r
\r
public Color(double h, double s, double v) {\r
this.h = (float)h;\r
this.s = (float)s;\r
this.v = (float)v;\r
- updateRGB(); \r
+ updateRGB(); \r
}\r
\r
public Color(RGB rgb) {\r
}\r
\r
if (s == 0.f) {\r
- h = Float.NaN; // saturation is 0 -> achromatic color\r
+ //h = Float.NaN; // saturation is 0 -> achromatic color\r
+ h = 0.f;\r
} else {\r
if (tr == v) {\r
h = 60.f * (tg - tb);\r
*/\r
private void updateRGB() {\r
if (s == 0.f) {\r
- //if (Float.isNaN(h)) {\r
- h = Float.NaN;\r
- r = floatToInt(v);\r
- g = floatToInt(v);\r
- b = floatToInt(v);\r
- //} else {\r
- // throw new RuntimeException("Saturation is 0 -> Hue must be undefined");\r
- //}\r
+ r = floatToInt(v);\r
+ g = floatToInt(v);\r
+ b = floatToInt(v);\r
} else {\r
while (h < 0.f)\r
h+= 360.f;\r