{COLOR } IS color-val
{COLOUR}
| Color | Foreground | Background |
|---|---|---|
| Black | 1 | 32 |
| Blue | 2 | 64 |
| Green | 3 | 96 |
| Cyan | 4 | 128 |
| Red | 5 | 160 |
| Magenta | 6 | 192 |
| Brown | 7 | 224 |
| White | 8 | 256 |
You may specify other video attributes by adding the following values:
| Reverse video | 1024 |
| Low intensity | 2048 |
| High intensity | 4096 |
| Underline | 8192 |
| Blink | 16384 |
| Protected | 32768 |
| Background low-intensity | 65536 |
| Background high-intensity | 131072 |
You may also specify high intensity by adding "8" to the foreground color value.
When a control is assigned a non-zero foreground or background color, that component will no longer revert to the default when assigned the value 0 (zero). Instead, assigning 0 simply reassigns the current color. The runtime uses this behavior to preserve one component (foreground or background) when changing the other.
01 my-field, ENTRY-FIELD, LINE 1, COL 1. MODIFY my-field, COLOR=32768
Instead, use a color variable to accomplish the effect, as in:
01 my-color PIC 9(5) VALUE ZERO.
01 my-field, ENTRY-FIELD, LINE 1, COL 1,
COLOR my-color.
ADD 32768 TO my-color.