contents.gifindex.gifprev1.gifnext1.gif

4.6.4 Color

The Terminal Manager can support terminals that support ANSI-style attribute handling. This style allows for independent setting of the background and foreground colors and does not interfere with the setting of other video attributes such as underlining. Color terminals that meet these criteria can enable color by adding entries to turn on the various foreground and background colors. Use the following table of attribute codes to set the correct color entries; if your terminal has fewer than eight colors, you should still make all eight entries for both foreground and background, repeating colors as necessary:

Foreground      Background      Color
    C1             B1           Black

C2 B2 Blue
C3 B3 Green
C4 B4 Cyan
C5 B5 Red
C6 B6 Magenta
C7 B7 Brown
C8 B8 White

Terminal definitions for color terminals do not need the RV, RB, and RU entries, because the Terminal Manager sends the appropriate foreground and background color codes instead.

4.6.4.1 One-color terminals

Some terminals can display text in only one color at a time. On these terminals it is impossible to display text with separate foreground and background colors, unless one of the colors is black. The termcap code OC (one color) tells the runtime to use special color handling to accommodate a terminal of this type.

If this code is present in the terminal's database entry, the runtime displays text using the correct color combinations set from COBOL, so long as either the foreground or background color is set to black. If neither the foreground nor the background is set to black, the runtime displays text using the foreground color (the background color is disregarded).

To use this code, add it to the terminal database entry preceded and followed by a colon (:OC:).