|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidadinternal.image.painter.ColorUtils
public class ColorUtils
The ColorUtils Class includes class functions for performing operations on colors.
Field Summary | |
---|---|
static int |
DEFAULT_LIGHTER_CHANGE
A good amount to modify a base color in order to calculate a lighter color, equal to approximately 200minosity, when calling getShadeColor(). |
static double |
NTSC_WEIGHT_BLUE
NTSC-specified weight to use for blue RGB component when converting to luminance. |
static double |
NTSC_WEIGHT_GREEN
NTSC-specified weight to use for green RGB component when converting to luminance. |
static double |
NTSC_WEIGHT_RED
NTSC-specified weight to use for red RGB component when converting to luminance. |
Constructor Summary | |
---|---|
ColorUtils()
|
Method Summary | |
---|---|
static int |
getApproximateLuminance(java.awt.Color color)
Returns the approximate luminosity of the color as an integer between 0 and 255, where 0 is black and 255 is white. |
static java.awt.Color |
shadeColor(java.awt.Color baseColor,
int change)
Given a base color, returns a new shade given a base color and an amount to change. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double NTSC_WEIGHT_RED
public static final double NTSC_WEIGHT_GREEN
public static final double NTSC_WEIGHT_BLUE
public static final int DEFAULT_LIGHTER_CHANGE
Constructor Detail |
---|
public ColorUtils()
Method Detail |
---|
public static int getApproximateLuminance(java.awt.Color color)
color
- The color to return the approximate luminance of.public static java.awt.Color shadeColor(java.awt.Color baseColor, int change)
baseColor
- The color to return the new shade ofchange
- The proposed amount to change each component of the
baseColor. Depending on the baseColor's luminance, the actual
amount the baseColor's components are changed may differ. The valid range
for this value is -255 to 255.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |