Color Class

Color Class

This Package | All Packages

public class Color
implements IConstructable

Describes a color in an object. The color can be described by an RGB (red, green, blue) triplet, or it can be a system color constant, such as the color of a command button [Color.CONTROL] To determine the appearance of Color constants with which you are unfamiliar (for example, Color.CONTROLDARKDARK), display a form, and select the color as the background color of the form.

Fields
Name Description
ACTIVEBORDER The color for active borders.
ACTIVECAPTION The color for active captions.
ACTIVECAPTIONTEXT The color for active caption text.
APPWORKSPACE The color of the application workspace.
BLACK The color black.
BLUE The color blue.
CONTROL The color for controls.
CONTROLDARK Topic controldark color.
CONTROLDARKDARK The controldarkdark color.
CONTROLLIGHT The controllight color.
CONTROLLIGHTLIGHT The controllightlight color.
CONTROLTEXT The color for control text.
DARKGRAY The color dark gray.
DESKTOP The desktop color.
GRAY The color gray.
GRAYTEXT The color for gray text.
GREEN The color green.
HIGHLIGHT The color for highlighted objects.
HIGHLIGHTTEXT The color for highlighted text.
HOTTRACK The hottrack color.
INACTIVEBORDER The color for inactive borders.
INACTIVECAPTION The color for inactive captions.
INACTIVECAPTIONTEXT The color for inactive caption text.
INFO The Info color.
INFOTEXT The InfoText color.
LIGHTGRAY The color light gray.
MENU The color for menus.
MENUTEXT The color for menu text.
RED The color red.
SCROLLBAR The color for scroll bars.
WHITE The color white.
WINDOW The color for windows.
WINDOWFRAME The color for window frames.
WINDOWTEXT The color for window text.

Constructors
Name Description
Color(int value) Creates a new Color object based on a full RGB triplet or system color value in an integer.
Color(int r, int g, int b) Creates a new Color object given individual red, green, and blue (RGB) values.

Methods
Name Description
equals(Object obj) Compares this color object to the color represented in the object you specify.
getBlue() Retrieves the blue component of the color, even if the color is a system color.
getConstructorArgs() Used by code generation at design time.
getGreen() Retrieves the green component of the color, even if the color is a system color.
getRed() Retrieves the red component of the color.
getRGB() Retrieves the entire RGB triplet for the color, even if the color is a system color.
getValue() Retrieves the current value of this Color object.
hashCode() Retrieves a hash code for this object for use with various sorting and hashtable objects.
toString() Retrieves a string description of the Color object.

Fields

Color.ACTIVEBORDER

Syntax
public static final Color ACTIVEBORDER;
Description
The color for active borders.

Color.ACTIVECAPTION

Syntax
public static final Color ACTIVECAPTION;
Description
The color for active captions.

Color.ACTIVECAPTIONTEXT

Syntax
public static final Color ACTIVECAPTIONTEXT;
Description
The color for active caption text.

Color.APPWORKSPACE

Syntax
public static final Color APPWORKSPACE;
Description
The color of the application workspace.

Color.BLACK

Syntax
public static final Color BLACK;
Description
The color black.

Color.BLUE

Syntax
public static final Color BLUE;
Description
The color blue.

Color.CONTROL

Syntax
public static final Color CONTROL;
Description
The color for controls.

Color.CONTROLDARK

Syntax
public static final Color CONTROLDARK;
Description
Topic controldark color.

Color.CONTROLDARKDARK

Syntax
public static final Color CONTROLDARKDARK;
Description
The controldarkdark color.

Color.CONTROLLIGHT

Syntax
public static final Color CONTROLLIGHT;
Description
The controllight color.

Color.CONTROLLIGHTLIGHT

Syntax
public static final Color CONTROLLIGHTLIGHT;
Description
The controllightlight color.

Color.CONTROLTEXT

Syntax
public static final Color CONTROLTEXT;
Description
The color for control text.

Color.DARKGRAY

Syntax
public static final Color DARKGRAY;
Description
The color dark gray.

Color.DESKTOP

Syntax
public static final Color DESKTOP;
Description
The desktop color.

Color.GRAY

Syntax
public static final Color GRAY;
Description
The color gray.

Color.GRAYTEXT

Syntax
public static final Color GRAYTEXT;
Description
The color for gray text.

Color.GREEN

Syntax
public static final Color GREEN;
Description
The color green.

Color.HIGHLIGHT

Syntax
public static final Color HIGHLIGHT;
Description
The color for highlighted objects.

Color.HIGHLIGHTTEXT

Syntax
public static final Color HIGHLIGHTTEXT;
Description
The color for highlighted text.

Color.HOTTRACK

Syntax
public static final Color HOTTRACK;
Description
The hottrack color.

Color.INACTIVEBORDER

Syntax
public static final Color INACTIVEBORDER;
Description
The color for inactive borders.

Color.INACTIVECAPTION

Syntax
public static final Color INACTIVECAPTION;
Description
The color for inactive captions.

Color.INACTIVECAPTIONTEXT

Syntax
public static final Color INACTIVECAPTIONTEXT;
Description
The color for inactive caption text.

Color.INFO

Syntax
public static final Color INFO;
Description
The Info color.

Color.INFOTEXT

Syntax
public static final Color INFOTEXT;
Description
The InfoText color.

Color.LIGHTGRAY

Syntax
public static final Color LIGHTGRAY;
Description
The color light gray.

Color.MENU

Syntax
public static final Color MENU;
Description
The color for menus.

Color.MENUTEXT

Syntax
public static final Color MENUTEXT;
Description
The color for menu text.

Color.RED

Syntax
public static final Color RED;
Description
The color red.

Color.SCROLLBAR

Syntax
public static final Color SCROLLBAR;
Description
The color for scroll bars.

Color.WHITE

Syntax
public static final Color WHITE;
Description
The color white.

Color.WINDOW

Syntax
public static final Color WINDOW;
Description
The color for windows.

Color.WINDOWFRAME

Syntax
public static final Color WINDOWFRAME;
Description
The color for window frames.

Color.WINDOWTEXT

Syntax
public static final Color WINDOWTEXT;
Description
The color for window text.

Constructors

Color.Color

Syntax 1
public Color( int value );
Parameters
value
The value for this Color object.
Description

Creates a new Color object based on a full RGB triplet or system color value in an integer.



Syntax 2
public Color( int r, int g, int b );
Parameters
r
The red component of the color.
g
The green component of the color.
b
The blue component of the color.
Description

Creates a new Color object given individual red, green, and blue (RGB) values.

Methods

Color.equals

Syntax
public boolean equals( Object obj );
Parameters
obj
The object to evaluate for a match.
Return Value

Returns true if the colors are the same; otherwise, returns false.

Description

Compares this color object to the color represented in the object you specify. If the object you specify is not a Color object, or the colors do not match, returns false.

Color.getBlue

Syntax
public int getBlue();
Return Value

Returns int the blue component of the color.

Description

Retrieves the blue component of the color, even if the color is a system color.

Color.getConstructorArgs

Syntax
public ConstructorArg[] getConstructorArgs();
Return Value

Returns the permissible constructor arguments.

Description

Used by code generation at design time. For more information, see

See Also
wd.core.IConstructable.

Color.getGreen

Syntax
public int getGreen();
Return Value

Returns the green component of the color.

Description

Retrieves the green component of the color, even if the color is a system color.

Color.getRed

Syntax
public int getRed();
Return Value

Returns the red component of the color, even if the color is a system color.

Description

Retrieves the red component of the color.

Color.getRGB

Syntax
public int getRGB();
Return Value

Returns the RGB triplet value.

Description

Retrieves the entire RGB triplet for the color, even if the color is a system color.

Color.getValue

Syntax
public int getValue();
Return Value

Returns int the value of the Color object.

Description

Retrieves the current value of this Color object. If this Color object is a system color, the high byte of the returned value will not be zero.

Color.hashCode

Syntax
public int hashCode();
Return Value

Returns a hashcode for this object.

Description

Retrieves a hash code for this object for use with various sorting and hashtable objects.

Color.toString

Syntax
public String toString();
Return Value

Returns a string describing the Color object.

Description

Retrieves a string description of the Color object.