* @returns the RGB Color object\r
*/\r
private static Color HSL2RGB(double h, double s, double l, double alpha) {\r
- if (s <0.0f || s > 100.0f) {\r
- String message = "Color parameter outside of expected range - Saturation: " + s;\r
- throw new IllegalArgumentException( message );\r
- }\r
-\r
- if (l <0.0f || l > 100.0f) {\r
- String message = "Color parameter outside of expected range - Luminance: " + l;\r
- throw new IllegalArgumentException( message );\r
- }\r
+ // we clamp the values, as it possible to come up with more than 100% sat/lum\r
+ // (see links in applyColorTransform() for more info)\r
+ s = Math.max(0, Math.min(100, s));\r
+ l = Math.max(0, Math.min(100, l));\r
\r
if (alpha <0.0f || alpha > 1.0f) {\r
String message = "Color parameter outside of expected range - Alpha: " + alpha;\r