CREATE COLOR


PLBCMP GUI Only

square.png Properties

square.png Methods

square.png Instructions

 

The CREATE COLOR statement initializes a twenty-four bit COLOR object. The object is used with other objects to set the color of the object. It uses one of the following formats:

 

(1)

[label]

CREATE

[{parent};]{color}

(2)

[label]

CREATE

[{parent};]{color}={red}:{green}:{blue}

(3)

[label]

CREATE

[{parent};]{color}={*colordef}

 

Where:

label

Optional. A Program Execution Label.

parent

Optional. A previously created WINDOW or PANEL object variable or pointer to a WINDOW or PANEL object on which the object is created.

color

Required. The name of a previously defined COLOR object variable or pointer to a COLOR object.

red

Required. A Numeric Variable, an Expression, or a decimal value that defines the red component of the BGR color.

green

Required. A Numeric Variable, an Expression, or a decimal value that defines the green component of the BGR color.

blue

Required. A Numeric Variable, an Expression, or a decimal value that defines the blue component of the BGR color.

colordef

Required. One of a set of default color definitions defined below.

Flags Affected: NONE

Note the following:

  1. The object contains three values, one each for the red, green and blue components of the color. Each value contains eight (8) bits of information. Any value given that is greater than 255 is treated as modulo 256.

  2. If the first format creates the color, the user is presented with a color dialog requesting that they choose the appropriate color.

  3. The color values may be retrieved by using the GETITEM instruction. Item zero is the entire twenty-four bit color, item one is the red component, item two is the green component, and item three is the blue component.

  4. The color values may be dynamically set by using the SETITEM instruction. Item zero is the entire twenty-four bit color, item one is the blue component, item two is the green component, and item three is the red component.

  5. Using format 3, {colordef} may be one of the following predefined values: *BLACK, *BLUE, *GREEN, *CYAN, *RED, *MAGENTA, *YELLOW, *WHITE, *GRAY, *DKGRAY, *MDGRAY, or *LTGRAY.

  6. If the optional {parent} parameter is not specified, the default window is used.

 

 

See Also: Example Code, CREATE, Object Output Instructions

 



PL/B Language Reference CREATE CHECKGRP CREATE COMBOBOX