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.


Variable Index

 o blueberry
The color blueberry
 o cherry
The color cherry
 o lemon
The color lemon
 o lime
The color lime

Constructor Index

 o AlphaColor(Color)
Create an AlphaColor from the specified Color.
 o AlphaColor(Color, int)
Create an AlphaColor from the specified Color and alpha value.
 o AlphaColor(float, float, float)
Create an AlphaColor with the specified red, green, and blue values in the range (0.0 - 1.0).
 o AlphaColor(float, float, float, float)
Create an AlphaColor with the specified red, green, blue and alpha values in the range (0.0 - 1.0).
 o 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.
 o AlphaColor(int, int, int)
Create an AlphaColor with the specified red, green, and blue values in the range (0 - 255).
 o AlphaColor(int, int, int, int)
Create an AlphaColor with the specified red, green, blue and alpha values in the range (0 - 255).

Method Index

 o adjustBrightness(Color, float)
Return a Color based on a supplied Color with its brightness adjusted.
 o adjustBrightness(float)
Return a copy of the AlphaColor with its brightness adjusted.
 o brighter()
Return a brighter version of this AlphaColor, preserving the alpha value.
 o contrastingColor()
Return either black or white, whichever contrasts more with this AlphaColor.
 o contrastingColor(AlphaColor)
Return either black or white, whichever contrasts more with the given AlphaColor.
 o contrastingColor(AlphaColor, int)
Return either black or white, whichever contrasts more with the given AlphaColor.
 o contrastingColor(Color)
Return either black or white, whichever contrasts more with the given Color.
 o contrastingColor(Color, int)
Return either black or white, whichever contrasts more with the given Color.
 o contrastingColor(int)
Return either black or white, whichever contrasts more with this AlphaColor.
 o copyright()
Copyright method to ensure that short copyright string appears in class file.
 o darker()
Return a darker version of this AlphaColor, preserving the alpha value
 o equals(Object)
Compares two AlphaColors.
 o findNewColor(AlphaColor[])
Return a color which is guaranteed not to match any of the AlphaColors in the supplied array
 o findNewColor(Color[])
Return a color which is guaranteed not to match any of the Colors in the supplied array
 o findNewColor(Vector)
Return a color which is guaranteed not to match any of the colors in the supplied vector.
 o getAlpha()
Return the alpha component.
 o getBlue()
Return the blue component.
 o getGreen()
Return the green component.
 o getRed()
Return the red component.
 o getRGBA()
Return an integer value representing the AlphaColor in the default RGB ColorModel.
 o nearestColor(Color)
Return the nearest solid color to the supplied color from the current palette.
 o toString()
Return a String representation of this AlphaColor's values.

Variables

 o lime

 public static final Color lime
The color lime

 o cherry

 public static final Color cherry
The color cherry

 o lemon

 public static final Color lemon
The color lemon

 o blueberry

 public static final Color blueberry
The color blueberry

Constructors

 o AlphaColor

 public AlphaColor(Color c)
Create an AlphaColor from the specified Color. The alpha value is set to 255.
See Also:
getRGB

 o AlphaColor

 public AlphaColor(Color c,
                   int alpha)
Create an AlphaColor from the specified Color and alpha value.

 o 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).

 o 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).

 o 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.

 o 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.

 o 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).

Methods

 o copyright

 public static String copyright()
Copyright method to ensure that short copyright string appears in class file.

 o 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.

 o 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.

 o brighter

 public AlphaColor brighter()
Return a brighter version of this AlphaColor, preserving the alpha value.

 o contrastingColor

 public Color contrastingColor()
Return either black or white, whichever contrasts more with this AlphaColor.

 o 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.

 o contrastingColor

 public static Color contrastingColor(AlphaColor c)
Return either black or white, whichever contrasts more with the given AlphaColor.

 o 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.

 o contrastingColor

 public static Color contrastingColor(Color c)
Return either black or white, whichever contrasts more with the given Color.

 o 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.

 o darker

 public AlphaColor darker()
Return a darker version of this AlphaColor, preserving the alpha value

 o 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

 o getAlpha

 public int getAlpha()
Return the alpha component.

 o getRed

 public int getRed()
Return the red component.

 o getGreen

 public int getGreen()
Return the green component.

 o getBlue

 public int getBlue()
Return the blue component.

 o 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).

 o toString

 public String toString()
Return a String representation of this AlphaColor's values.
Overrides:
toString in class Object

 o findNewColor

 public static Color findNewColor(Color testColors[])
Return a color which is guaranteed not to match any of the Colors in the supplied array

 o findNewColor

 public static Color findNewColor(AlphaColor testColors[])
Return a color which is guaranteed not to match any of the AlphaColors in the supplied array

 o 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.

 o 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.