Author: dsvyatobatsko
Date: 2008-03-06 10:48:45 -0500 (Thu, 06 Mar 2008)
New Revision: 6602
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java
Log:
http://jira.jboss.com/jira/browse/RF-2403 fix
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java
===================================================================
---
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java 2008-03-06
14:36:00 UTC (rev 6601)
+++
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java 2008-03-06
15:48:45 UTC (rev 6602)
@@ -171,9 +171,14 @@
+ "Difference parameter should be floating-point values between
-1 and 1");
}
- float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
- float brightness = Math.min(1.0f, Math.max(0.0f, hsb[2] + difference));
- return new Color(Color.HSBtoRGB(hsb[0], hsb[1], brightness));
+ Color retVal = null;
+ if (c != null) {
+ float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
+ float brightness = Math.min(1.0f, Math.max(0.0f, hsb[2] + difference));
+ retVal = new Color(Color.HSBtoRGB(hsb[0], hsb[1], brightness));
+ }
+
+ return retVal;
}
/**
@@ -199,9 +204,14 @@
+ "Difference parameter should be floating-point values between
-1 and 1");
}
- float[] hsl = RGBtoHSL(c.getRed(), c.getGreen(), c.getBlue());
- float lightness = Math.min(1.0f, Math.max(0.0f, hsl[2] + difference));
- return HSLtoRGB(hsl[0], hsl[1], lightness);
+ Color retVal = null;
+ if (c != null) {
+ float[] hsl = RGBtoHSL(c.getRed(), c.getGreen(), c.getBlue());
+ float lightness = Math.min(1.0f, Math.max(0.0f, hsl[2] + difference));
+ retVal = HSLtoRGB(hsl[0], hsl[1], lightness);
+ }
+
+ return retVal;
}
/**