Please enable JavaScript to view this site.

ESL Documentation

Keyword

Specify a color.

[color] COLOR

COLOR

A color keyword, a string value representing a color keyword, or an integer value representing a color number corresponding to a color available on your system. Refer to the appropriate object definition, action statement, or drawing statement for the proper format within which the COLOR specification must appear.

 

The standard ESL color set consists of the following keywords and numbers:

Color Keyword

Color Number

red

1

green

2

yellow

3

blue

4

magenta

5

purple

5

cyan

6

aqua

6

white

7

black

8

 

You may also be able to use color numbers 18-25; see "Additional ESL Colors." The specific set of color numbers available to you is dependent on your computer's graphics hardware.

Description

Use this statement to specify the color used for any of the following:

Foreground of a key

Foreground, background, and/or border of a graphical, image, or textual region

Foreground and/or background of text in a colored textual region

Color of a drawing statement

Foreground or background of all dialog controls

If you use an integer value or a string value to describe a color, you must precede it with the keyword color. The color keyword is only optional if you specify a keyword indicating a color, without quotation marks.

Colors in Dialog Control Objects

To change the foreground and background color of objects at runtime, use the make COLOR action statement. You can use the built-in functions background of and foreground of to report the background and foreground colors of all controls.

Additional ESL Colors

You can specify colors 18-25 for objects. The following table lists the colors that correspond to these color numbers.

Color Number

Windowed Color

18

dark gray

19

dark blue

20

dark red

21

dark purple

22

dark green

23

turquoise

24

mustard

25

light gray

Default Background and Foreground Colors

Colors 26 and 27 are set in the Windows Control Panel. These colors cannot be used in a colored textual region.

ESL Color 26 (Background)

The default background color for a control object is color 26 (the system background color for the object). The actual color used depends on the type of control to which you are applying it, as shown in the following table:

Control

Color of Object Used

Check Box

Window Background

Combination Box :

Simple

Drop-down

Drop-down List

Entry field/List box Background

Entry Field

Entry field/List box Background

Group Box

Window Background

List Box

Entry field/List box Background

Multiple- line Entry Field

Window Background

Push Button

Push button Background

Radio Button

Window Background

Spin Button

Entry field/List box Background

Static Text

Window Background

Table

Window Background

ESL Color 27 (Foreground)

The default foreground color for an object is color 27 (the system foreground color for the object). The actual color used depends on the type of control to which you are applying it, as shown in the following table.

Control

Color of Object Used

Check Box

Menu Text

Combination Box :

Simple

Dropdown

Dropdown List

Window Text

Entry Field

Window Text

Group Box

Static Text

List Box

Window Text

Multiple- line Entry Field

Window Text

Push Button

Menu Text

Radio Button

Menu Text

Spin Button

Window Text

Static Text

Static Text

Table

Window Text

Default Values

If you do not specify a color for a drawing statement, the drawing statement uses the foreground color specified in the object definition.

If no color is specified in the object definition, the following default colors are used in windowed and fullscreen programs:

Object

Default Color

Key

white

Graphical, Image, and

Textual Region

white foreground

black background

white border

Example

disabled yellow key Box_Key at position 50 50

blue box 25 25

move to 100 100

circle radius 20

 

color ColorChoice textual region Blackboard_TR

window size 30 30

at position 100 100

 

color 24 key Help_Key at position 45 30

See Also

graphical region, image region, textual region Definitions

key Definition

make background and make foreground COLOR Action Statement

make block and make segment COLOR Action Statements

make border COLOR Action Statement

make color Action Statement

check box, combination box, dropdown list, entry field, group box, list box,

multi line entry field, push button, radio button, spin button, static text Definitions