|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.image.painter.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 20% luminosity, 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 java.awt.Color |
darkerShadeColor(java.awt.Color baseColor)
Convenience function that calls shadeColor() to return a darker color given a base color. |
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 double |
getNTSCLuminance(java.awt.Color color)
Returns the luminosity of the color as a double between 0.0 and 1.0, where 0.0 is black and 1.0 is white, using the NTSC contribution weights (.299, .587, .144) for the red, green, and blue components. |
static java.awt.Color |
lighterShadeColor(java.awt.Color baseColor)
Convenience function that calls shadeColor() to return a lighter color given a base color. |
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.
getNTSCLuminance(java.awt.Color)
public static double getNTSCLuminance(java.awt.Color color)
color
- The color to return the NTSC luminance of.
getApproximateLuminance(java.awt.Color)
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.
lighterShadeColor(java.awt.Color)
,
darkerShadeColor(java.awt.Color)
public static final java.awt.Color lighterShadeColor(java.awt.Color baseColor)
baseColor
- Color to return a lighter shade of
shadeColor(java.awt.Color, int)
,
darkerShadeColor(java.awt.Color)
public static final java.awt.Color darkerShadeColor(java.awt.Color baseColor)
baseColor
- Color to return a darker shade of
shadeColor(java.awt.Color, int)
,
lighterShadeColor(java.awt.Color)
|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |