Class FxColor
public class FxColor extends BaseColor
{
// Constructors
public FxColor(int r, int g, int b);
public FxColor(int rgb);
public FxColor(float r, float g, float b);
// Methods
public Color brightenColor(int nPercent);
public Color darkenColor(int nPercent);
public Color getDarkShadow();
public Color getHilight();
public Color getLightHilight();
public Color getShadow();
}
This class handles extended, user-definable color objects.
BaseColor
|
+--FxColor
public FxColor(int r, int g, int b);
Creates a color with the specified red, green, and blue values in the range of 0 through 255. The actual color used in rendering depends on finding the best match, given the color space available for a specific output device.
Parameter | Description |
r
| The red component of the color.
|
g
| The green component of the color.
|
b
| The blue component of the color.
|
See Also: java.awt.image.ColorModel.getRed, java.awt.image.ColorModel.getGreen, java.awt.image.ColorModel.getBlue, java.awt.image.ColorModel.getRGB
public FxColor(int rgb);
Creates a color with the specified combined RGB value. The actual color used in rendering depends on finding the best match, given the color space available for a specific output device.
Parameter | Description |
rgb
| The combined RGB components.
|
See Also: java.awt.image.ColorModel.getRed, java.awt.image.ColorModel.getGreen, java.awt.image.ColorModel.getBlue, java.awt.image.ColorModel.getRGB
public FxColor(float r, float g, float b);
Creates a color with the specified red, green, and blue values in the range of 0.0 to 1.0. The actual color used in rendering depends on finding the best match, given the color space available for a specific output device.
Parameter | Description |
r
| The red component of the color.
|
g
| The green component of the color.
|
b
| The blue component of the color.
|
See Also: java.awt.image.ColorModel.getRed, java.awt.image.ColorModel.getGreen, java.awt.image.ColorModel.getBlue, java.awt.image.ColorModel.getRGB
public Color brightenColor(int nPercent);
Retrieve a new color, which is a highlighted version of the current color.
Return Value:
Returns a Color that is nPercent brighter than the current color.
Parameter | Description |
nPercent
| The relative brightness for the new color.
|
public Color darkenColor(int nPercent);
Retrieves a new color, which is a darkened version of the current color.
Return Value:
Returns a Color that is nPercent darker than the current color.
Parameter | Description |
nPercent
| The relative darkness for the new color.
|
public Color getDarkShadow();
Retrieves the dark shadow of the current color.
Return Value:
Currently, this method returns Color.black.
public Color getHilight();
Retrieves a new color, which is the highlight for the current color.
Return Value:
Returns a brighter Color.
public Color getLightHilight();
Retrieves a new color, which is a highlighted version of the current color.
Return Value:
Currently, this method returns the same color as the current color.
public Color getShadow();
Retrieves a new color, which is the shadow of the current color. The shadow is approximately one-third darker than the current color.
Return Value:
Returns a darker Color.