All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.beans.gauge.AlphaColor
java.lang.Object
|
+----COM.ibm.beans.gauge.AlphaColor
- public class AlphaColor
- extends Object
This class provides additional support for holding an alpha
channel value in addition to the usual RGB values. The primary
value of this extension is to allow the Fill class (using the
ColorGradient class) to introduce levels of transparency into
images.
blueberry
- The color blueberry
cherry
- The color cherry
lemon
- The color lemon
lime
- The color lime
AlphaColor(Color)
- Create an AlphaColor from the specified Color.
AlphaColor(Color,
int)
- Create an AlphaColor from the specified Color and alpha
value.
AlphaColor(float,
float, float)
- Create an AlphaColor with the specified red, green, and
blue values in the range (0.0 - 1.0).
AlphaColor(float,
float, float, float)
- Create an AlphaColor with the specified red, green, blue
and alpha values in the range (0.0 - 1.0).
AlphaColor(int)
- Create an AlphaColor with the specified combined RGB
value consisting of the alpha component in bits 24-31,
the red component in bits 16-23, the green component in
bits 8-15, and the blue component in bits 0-7.
AlphaColor(int,
int, int)
- Create an AlphaColor with the specified red, green, and
blue values in the range (0 - 255).
AlphaColor(int,
int, int, int)
- Create an AlphaColor with the specified red, green, blue
and alpha values in the range (0 - 255).
adjustBrightness(Color,
float)
- Return a Color based on a supplied Color with its
brightness adjusted.
adjustBrightness(float)
- Return a copy of the AlphaColor with its brightness
adjusted.
brighter()
- Return a brighter version of this AlphaColor, preserving
the alpha value.
contrastingColor()
- Return either black or white, whichever contrasts more
with this AlphaColor.
contrastingColor(AlphaColor)
- Return either black or white, whichever contrasts more
with the given AlphaColor.
contrastingColor(AlphaColor,
int)
- Return either black or white, whichever contrasts more
with the given AlphaColor.
contrastingColor(Color)
- Return either black or white, whichever contrasts more
with the given Color.
contrastingColor(Color,
int)
- Return either black or white, whichever contrasts more
with the given Color.
contrastingColor(int)
- Return either black or white, whichever contrasts more
with this AlphaColor.
copyright()
- Copyright method to ensure that short copyright string
appears in class file.
darker()
- Return a darker version of this AlphaColor, preserving
the alpha value
equals(Object)
- Compares two AlphaColors.
findNewColor(AlphaColor[])
- Return a color which is guaranteed not to match any of
the AlphaColors in the supplied array
findNewColor(Color[])
- Return a color which is guaranteed not to match any of
the Colors in the supplied array
findNewColor(Vector)
- Return a color which is guaranteed not to match any of
the colors in the supplied vector.
getAlpha()
- Return the alpha component.
getBlue()
- Return the blue component.
getGreen()
- Return the green component.
getRed()
- Return the red component.
getRGBA()
- Return an integer value representing the AlphaColor in
the default RGB ColorModel.
nearestColor(Color)
- Return the nearest solid color to the supplied color from
the current palette.
toString()
- Return a String representation of this AlphaColor's
values.
lime
public static final Color lime
- The color lime
cherry
public static final Color cherry
- The color cherry
lemon
public static final Color lemon
- The color lemon
blueberry
public static final Color blueberry
- The color blueberry
AlphaColor
public AlphaColor(Color c)
- Create an AlphaColor from the specified Color. The alpha
value is set to 255.
- See Also:
- getRGB
AlphaColor
public AlphaColor(Color c,
int alpha)
- Create an AlphaColor from the specified Color and alpha
value.
AlphaColor
public AlphaColor(float r,
float g,
float b)
- Create an AlphaColor with the specified red, green, and
blue values in the range (0.0 - 1.0).
AlphaColor
public AlphaColor(float r,
float g,
float b,
float a)
- Create an AlphaColor with the specified red, green, blue
and alpha values in the range (0.0 - 1.0).
AlphaColor
public AlphaColor(int rgba)
- Create an AlphaColor with the specified combined RGB
value consisting of the alpha component in bits 24-31,
the red component in bits 16-23, the green component in
bits 8-15, and the blue component in bits 0-7.
AlphaColor
public AlphaColor(int r,
int g,
int b)
- Create an AlphaColor with the specified red, green, and
blue values in the range (0 - 255). The alpha value is
set to 255.
AlphaColor
public AlphaColor(int r,
int g,
int b,
int a)
- Create an AlphaColor with the specified red, green, blue
and alpha values in the range (0 - 255).
copyright
public static String copyright()
- Copyright method to ensure that short copyright string
appears in class file.
adjustBrightness
public static Color adjustBrightness(Color in,
float adjust)
- Return a Color based on a supplied Color with its
brightness adjusted.
The supplied Color is converted
to the HSB colour model and the brightness value adjusted
according to the adjustment parameter. The adjustment
value is a floating point between -1 and 1. A value of -1
will make the brightness value 0, a value of 1 will make
it 1. Any other positive value adjusts the brightness
upwards by a proportionate amount, whilst a negative
value will adjust the brightness downwards by a
proportionate amount.
adjustBrightness
public AlphaColor adjustBrightness(float adjust)
- Return a copy of the AlphaColor with its brightness
adjusted.
The current AlphaColor is converted to the
HSB colour model, ignoring the alpha value, and the
brightness value adjusted according to the adjustment
parameter. The adjustment value is a floating point
between -1 and 1. A value of -1 will make the brightness
value 0, a value of 1 will make it 1. Any other positive
value adjusts the brightness upwards by a proportionate
amount, whilst a negative value will adjust the
brightness downwards by a proportionate amount.
brighter
public AlphaColor brighter()
- Return a brighter version of this AlphaColor, preserving
the alpha value.
contrastingColor
public Color contrastingColor()
- Return either black or white, whichever contrasts more
with this AlphaColor.
contrastingColor
public Color contrastingColor(int threshold)
- Return either black or white, whichever contrasts more
with this AlphaColor. The
threshold
is a
percentage that specifies the luminance level at which
black switches to white with 50 being half way between
the two.
contrastingColor
public static Color contrastingColor(AlphaColor c)
- Return either black or white, whichever contrasts more
with the given AlphaColor.
contrastingColor
public static Color contrastingColor(AlphaColor c,
int threshold)
- Return either black or white, whichever contrasts more
with the given AlphaColor. The
threshold
is
a percentage that specifies the luminance level at which
black switches to white with 50 being half way between
the two.
contrastingColor
public static Color contrastingColor(Color c)
- Return either black or white, whichever contrasts more
with the given Color.
contrastingColor
public static Color contrastingColor(Color c,
int threshold)
- Return either black or white, whichever contrasts more
with the given Color. The
threshold
is a
percentage that specifies the luminance level at which
black switches to white with 50 being half way.
darker
public AlphaColor darker()
- Return a darker version of this AlphaColor, preserving
the alpha value
equals
public boolean equals(Object obj)
- Compares two AlphaColors. An AlphaColor is never equal to
a color. Two AlphaColors are considered to be equal if
the red, green, blue and values of both AlphaColors
match.
- Overrides:
- equals
in class Object
getAlpha
public int getAlpha()
- Return the alpha component.
getRed
public int getRed()
- Return the red component.
getGreen
public int getGreen()
- Return the green component.
getBlue
public int getBlue()
- Return the blue component.
getRGBA
public int getRGBA()
- Return an integer value representing the AlphaColor in
the default RGB ColorModel. (Bits 24-31 are alpha, 16-23
are red, 8-15 are green, 0-7 are blue).
toString
public String toString()
- Return a String representation of this AlphaColor's
values.
- Overrides:
- toString
in class Object
findNewColor
public static Color findNewColor(Color testColors[])
- Return a color which is guaranteed not to match any of
the Colors in the supplied array
findNewColor
public static Color findNewColor(AlphaColor testColors[])
- Return a color which is guaranteed not to match any of
the AlphaColors in the supplied array
findNewColor
public static synchronized Color findNewColor(Vector testColors)
- Return a color which is guaranteed not to match any of
the colors in the supplied vector.
nearestColor
public static Color nearestColor(Color col)
- Return the nearest solid color to the supplied color from
the current palette.
All Packages Class Hierarchy This Package Previous Next Index
Copyright ©
Taligent, Inc. 1996 - 1997.
Copyright © IBM Corporation 1996 - 1997.
All Rights Reserved.