GPColor

Unit : GPColorUnit
Association : GPColorAsn
Inherits from : None

Description

A color for use with other GP objects. Colors are made of red, green, and blue components.

Public Interface

CONSTRUCTOR Init;
Initializes a GPColor as black.

CONSTRUCTOR InitWithRGB (r, g, b: integer);
Initializes a GPColor with red, green, and blue values. Each value must be between 0 and 255.

CONSTRUCTOR InitAs (name : string);
Initializes a GPColor with the named color. If no such color with that name exists, it uses the color with the closest matching name. There are a lot of colors available. See GPColorUnit for more details.

CONSTRUCTOR InitAsRed;
Initializes a GPColor as red.

CONSTRUCTOR InitAsOrange;
Initializes a GPColor as orange.

CONSTRUCTOR InitAsYellow;
Initializes a GPColor as yellow.

CONSTRUCTOR InitAsGreen;
Initializes a GPColor as green.

CONSTRUCTOR InitAsBlue;
Initializes a GPColor as blue.

CONSTRUCTOR InitAsPurple;
Initializes a GPColor as purple.

CONSTRUCTOR InitAsBlack;
Initializes a GPColor as black.

CONSTRUCTOR InitAsWhite;
Initializes a GPColor as white.

DESTRUCTOR Destroy;
Destroys a GPColor.

FUNCTION Equal(other: GPColor): boolean;
Returns TRUE if other parameter has the same red, green, blue values as this instance; otherwise returns FALSE.

FUNCTION GetName: string;
Returns the name of the color. If the color has no name, the string returned is made up of the color's red, green, and blue color values.

PROCEDURE GetRGB (VAR r, g, b: integer);
Sets the parameters equal to the red, green, and blue color values, respectively.

FUNCTION GetR: integer;
Returns the red value of the GPColor.

FUNCTION GetG: integer;
Returns the green value of the GPColor.

FUNCTION GetB: integer;
Returns the blue value of the GPColor.

PROCEDURE ChangeRGBTo (r, g, b: integer);
Changes the GPColor to specified red, green, and blue values. Each value must be between 0 and 255.

PROCEDURE ChangeTo (name : string);
Changes the GPColor to the named color. If no such color with that name exists, it uses the color with the closest matchin name.

PROCEDURE ChangeToRed;
Changes the GPColor to red.

PROCEDURE ChangeToOrange;
Changes the GPColor to orange.

PROCEDURE ChangeToYellow;
Changes the GPColor to yellow.

PROCEDURE ChangeToGreen;
Changes the GPColor to green.

PROCEDURE ChangeToBlue;
Changes the GPColor to blue.

PROCEDURE ChangeToPurple;
Changes the GPColor to purple.

PROCEDURE ChangeToBlack;
Changes the GPColor to black.

PROCEDURE ChangeToWhite;
Changes the GPColor to white.

Subclasses

None

Please report any problems with GP or the documentation to GP Support .


GP Home Page GP Documentation
Loring Holden