public abstract class IltColorModifier extends Object
modify
is invoked for
each animated pixel of the gauge or chart.
This class also contains some utility methods to write color modifiers.
Especially, the methods Red, Green, Blue & Color
allow to easily code or decode colors in the default RGB color model.
Modifier and Type | Class and Description |
---|---|
static class |
IltColorModifier.MultiColor
This class is a color modifier that produces a green representation,
when the value is below
0.5 , a yellow representation when the value
is below 0.75 , and a red representation when the value is above 0.75 . |
static class |
IltColorModifier.Shade
This class is a color modifier that produces a transparent
color shade effect.
|
Modifier and Type | Field and Description |
---|---|
static IltColorModifier |
Standard
This color modifier returns
foregroundColor or
backgroundColor according to the value returned by
UseForegroundColor . |
Constructor and Description |
---|
IltColorModifier() |
Modifier and Type | Method and Description |
---|---|
static int |
Blue(int color)
Returns the blue component of the given color.
|
static int |
Color(int red,
int green,
int blue)
Returns the blue component of the given color.
|
IltColorModifier |
compose(IltColorModifier cm)
Returns a color modifier that composes this color modifier with the given
one.
|
static int |
Green(int color)
Returns the green component of the given color.
|
abstract int |
modify(int backgroundColor,
int foregroundColor,
IltColorModifierContext context)
This method is invoked for each animated pixel of the gauge or chart.
|
static int |
Red(int color)
Returns the red component of the given color.
|
static boolean |
UseForegroundColor(IltColorModifierContext context)
Returns
true when the foreground color should be used, otherwise it returns false . |
public static final IltColorModifier Standard
foregroundColor
or
backgroundColor
according to the value returned by
UseForegroundColor
.
public abstract int modify(int backgroundColor, int foregroundColor, IltColorModifierContext context)
ColorModel
for a particular device or for all images. It is merely used as a
common color model format.
This method is supposed to be overridden to implement the appropriate color modification.
backgroundColor
- The background color of the chart for this pixel.foregroundColor
- The foreground color of the chart for this pixel.context
- The context for this pixel.ColorModel.getRGBdefault()
,
IltColorModifierContext
public static final boolean UseForegroundColor(IltColorModifierContext context)
true
when the foreground color should be used, otherwise it returns false
.
This method returns true
when pixelValue
is lower than barValue
,
and false
when pixelValue is greater than barValue
.public static final int Red(int color)
color
- A color in the default RGB color model.public static final int Green(int color)
color
- A color in the default RGB color model.public static final int Blue(int color)
color
- A color in the default RGB color model.public static final int Color(int red, int green, int blue)
red
- The red component of this color in the range 0..255
.green
- The green component of this color in the range 0..255
.blue
- The blue component of this color in the range 0..255
.public IltColorModifier compose(IltColorModifier cm)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.