Color Attributes

Terminal attribute codes are defined constants in vv_sys.h. The constants are in the form COLOR1, COLOR2, etc. In addition, INVISIBLE is available.

The actual foreground/background color combination associated with a terminal attribute code is determined by the control sequence assigned to the attribute code. The control sequences are assigned to the attribute code by using Vermont Views mnemonic entries defined in the vvtermcap file. Each terminal attribute code must be associated with a control sequence that is defined to set the proper foreground/background colors (using a or "set color" mnemonic) and to reset the foreground/background colors to the NORMAL video state (using a , or "reset color" mnemonic).

Thus, to set the physical attribute for the color column in the UNIX, POSIX, and VMS logical attribute table, you simply specify one of the terminal attribute codes COLOR1 to COLOR16 or INVISIBLE.

We have defined the foreground and background color combinations for ANSI-standard terminals. For example, COLOR1 is defined by the mnemonics scl0 and rcl0. These mnemonics are mapped to control sequences that set COLOR1 to refer to a black foreground on a blue background.

Table 46.5 lists the terminal attribute codes, the mnemonics they are associated with, and the foreground/background colors initially assigned to the ANSI-standard terminals.

To change the colors associated with any of the terminal attribute codes, change the control sequences assigned to their mnemonics in the vvtermcap entry for the ANSI-standard terminal.

To add more terminal attribute codes, you will have to make additions to the vvtermcap entry for the ANSI-standard terminal. In addition, the only color mappings that we have defined are for the ANSI-standard terminal. If you have another type of color terminal, you must add the color mappings to foreground and background colors to the vvtermcap entry for that terminal. See Chapter 58, "Modifying the Terminal Interface," for more information on adding terminal attribute codes or supporting different terminals.

Table 46.5: Default Mappings for the ANSI-Standard Terminal

Terminal Attribute Code Mnemonic Set, Reset Foreground/Background Color used in control sequence in vvtermcap
COLOR1 scl0, rcl0 BLACK / BLUE
COLOR2 scl1, rcl1 BLUE / WHITE
COLOR3 scl2, rcl2 GREEN / BLUE
COLOR4 scl3, rcl3 CYAN / BLUE
COLOR5 scl4, rcl4 RED / BLUE
COLOR6 scl5, rcl5 MAGENTA / BLUE
COLOR7 scl6, rcl6 BROWN / BLUE
COLOR8 scl7, rcl7 WHITE / BLUE
COLOR9 scl8, rcl8 WHITE / BLACK
COLOR10 scl9, rcl9 WHITE / BLUE
COLOR11 scl10, rcl10 BLUE / WHITE
COLOR12 scl11, rcl11 INT. WHITE / BLUE
COLOR13 scl12, rcl12 BLINK RED / BLACK
COLOR14 scl13, rcl13 RED / BLACK
COLOR15 scl14, rcl14 CYAN / BLUE
COLOR16 scl15, rcl15 BLACK / CYAN
INVISIBLE    


Home Contents Previous Next