Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.fx   Previous This
Package
Next

 


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

Constructors

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.

ParameterDescription
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

FxColor

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.

ParameterDescription
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

FxColor

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.

ParameterDescription
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

Methods

brightenColor

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.

ParameterDescription
nPercent The relative brightness for the new color.

darkenColor

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.

ParameterDescription
nPercent The relative darkness for the new color.

getDarkShadow

public Color getDarkShadow();

Retrieves the dark shadow of the current color.

Return Value:

Currently, this method returns Color.black.

getHilight

public Color getHilight();

Retrieves a new color, which is the highlight for the current color.

Return Value:

Returns a brighter Color.

getLightHilight

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.

getShadow

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.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.