ContentsIndexPreviousNext

Adding Color

It is possible to add color to programs that were written for black-and-white terminals by assigning color values to the runtime configuration variable COLOR_MAP. The COLOR_MAP keyword is followed by one of the following single attributes:

High, Low, Reverse, Blink, Underline, Default, or Exit,

or by one of the following hyphenated combinations of attributes:

High-Reverse Low-Reverse
High-Blink Low-Blink
High-Reverse-Blink Low-Reverse-Blink
High-Underline Low-Underline
High-Reverse-Underline Low-Reverse-Underline
Reverse-Blink Reverse-Underline

The single attribute, or attribute combination, is then followed by an equal sign (optionally a colon on DOS) and one of the following color names:

Black Blue Green Cyan Red Magenta Brown White

The named color becomes the foreground color used whenever the corresponding attribute is used. For example, to make low-intensity fields green, use the following runtime configuration file entry:

COLOR_MAP  Low=Green

Assign a background color value by adding a second (background) color, separated by a comma. For example, to assign white characters on a blue background for high-intensity fields:

COLOR_MAP  High=White,Blue

To specify more than one attribute in a single COLOR_MAP line, separate the attributes by spaces:

COLOR_MAP  High=Green  Low=Red  Reverse=Blue


Note: On some terminals, specifying High=Brown causes yellow to be generated by any DISPLAY HIGH phrase.

Also Note: Colors you specify with COLOR_MAP can be overridden by ACCEPT or DISPLAY statement phrases in the source program.