Package com.ms.fx Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class FxColor

Constructors , Methods

public class FxColor extends Color 
{
  // Constructors
  public FxColor(int r, int g, int b);
  public FxColor(int rgb);
  public FxColor(float r, float g, float b);

  // Methods
  public Color getDarkShadow();
  public Color getLightHilight();
  public Color getShadow();
  public Color darkenColor(int nPercent);
  public Color getHilight();
  public Color brightenColor(int nPercent);
}

An extended color class.


Constructors


FxColor

public FxColor(int r, int g, int b);

Creates a color with the specified red, green, and blue values in the range (0 - 255). The actual color used in rendering will depend on finding the best match given the color space available for a given output device.

ParameterDescription
r The red component.
g The green component.
b The blue component.

See Also: getRed, getGreen, getBlue, getRGB


FxColor

public FxColor(int rgb)

Creates a color with the specified combined RGB value. The actual color used in rendering will depend on finding the best match given the color space available for a given output device.

ParameterDescription
rgb The combined RGB components.

See Also: getRGBdefault, getRed, getGreen, getBlue, getRGB


FxColor

public FxColor(float r, float g, float b);

Creates a color with the specified red, green, and blue values in the range (0.0 - 1.0). The actual color used in rendering will depend on finding the best match given the color space available for a given output device.

ParameterDescription
r The red component.
g The red component.
b The red component.

See Also: getRed, getGreen, getBlue, getRGB


Methods


getDarkShadow

public Color getDarkShadow();

Retrieves an even darker Color than getShadow.

Return Value:

Returns a new colour which is a darkened shadow of the current color.


getLightHilight

public Color getLightHilight();

Retrieves an even brighter Color than getHilight.

Return Value:

Returns a new colour which is the light highlight of the current color.


getShadow

public Color getShadow();

Return a new color which is the shadow of the current color.

Return Value:

Returns a darker Color.


darkenColor

public Color darkenColor(int nPercent);

Retrieve a new color which is a darkened version of this one.

Return Value:

Returns a Color that is nPercent darker than the current one.

ParameterDescription
nPercent The relative darkness for the new color.


getHilight

public Color getHilight();

Return a new color which is the highlight for the current color.

Return Value:

Returns a brighter Color.


brightenColor

public Color brightenColor(int nPercent);

Retrieve a new color which is a highlighted version of this one.

Return Value:

Returns a Color that is nPercent brighter than the current one.

ParameterDescription
nPercent The relative brightness for the new color.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.