|
RichFaces Core API 4.1.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.richfaces.renderkit.util.ColorUtils
public final class ColorUtils
Utility methods that are useful for color processing.
| Method Summary | |
|---|---|
static Color |
adjustBrightness(Color c,
float difference)
Increases/decreases brightness of the given color by the specified difference. |
static Color |
adjustLightness(Color c,
float difference)
Increases/decreases lightness of the given color by the specified difference. |
static Color |
convertHSLtoRGB(float h,
float s,
float l)
Converts the components of a color, as specified by the HSL model, to an equivalent set of values for the default RGB model. |
static float[] |
convertRGBtoHSL(int r,
int g,
int b)
Converts the components of a color, as specified by the default RGB model, to an equivalent set of values for hue, saturation, and lightness that are the three components of the HSL model. |
static Color |
overwriteAlpha(Color c,
float alpha)
Overwrites alpha value for given color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static float[] convertRGBtoHSL(int r,
int g,
int b)
r - the red component of the colorg - the green component of the colorb - the blue component of the color
public static Color convertHSLtoRGB(float h,
float s,
float l)
The saturation and lightness components should be floating-point values between zero and one
(numbers in the range 0.0-1.0). The hue component can be any floating-point number. The floor of this number
is subtracted from it to create a fraction between 0 and 1. This fractional number is then multiplied by 360 to produce
the hue angle in the HSB color model.
h - the hue component of the colors - the saturation of the colorl - the lightness of the color
public static Color adjustBrightness(Color c,
float difference)
difference.
The difference values in the range (-1.0, 1.0): 1.0 - the brightest value; -1.0 - the dimmest value.
c - color to adjustdifference - value to be added to the current brightness
Color instance with increased/decreased brightness by specified difference
IllegalArgumentException - if difference is outside of the range -1.0 to 1.0, inclusive
public static Color adjustLightness(Color c,
float difference)
difference.
The difference values in the range (-1.0, 1.0): 1.0 - the lightest value; -1.0 - on the contrary.
c - color to adjustdifference - value to be added to the current lightness
Color instance with increased/decreased lightness by specified difference
IllegalArgumentException - if difference is outside of the range -1.0 to 1.0, inclusive
public static Color overwriteAlpha(Color c,
float alpha)
c - color to overwritealpha - a new value of alpha
Color object with a new specified alpha value
|
RichFaces Core API 4.1.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||