HP-UX Reference (11i v1 00/12) - 4 File Formats (vol 8)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man4/!!!intro.4
________________________________________________________________
___ ___
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
The numeric variables colors and pairs define the number of colors and color-pairs that can be
displayed on the screen at the same time. If a terminal can change the definition of a color (for example,
the Tektronix 4100 and 4200 series terminals), this should be specified with ccc (can change color). To
change the definition of a color (Tektronix 4200 method), use initc (initialize color). It requires four argu-
ments: color number (ranging from 0 to colors1) and three RGB (red, green, and blue) values or three
HLS colors (Hue, Lightness, Saturation). Ranges of RGB and HLS values are terminal-dependent.
Tektronix 4100 series terminals only use HLS color notation. For such terminals (or dual-mode terminals
to be operated in HLS mode) one must define a boolean variable hls; that would instruct the
init_color() function (see can_change_color(3X)) to convert its RGB arguments to HLS before sending
them to the terminal. The last three arguments to the initc string would then be HLS values.
If a terminal can change the definitions of colors, but uses a color notation different from RGB and HLS, a
mapping to either RGB or HLS must be developed.
If the terminal supports ANSI escape sequences to set background and foreground, they should be coded as
setab and setaf, respectively. If the terminal supports other escape sequences to set background and
foreground, they should be coded as setb and setf, respectively. The vidputs() function (see
vidattr(3X)) and the refresh functions use setab and setaf if they are defined. Each of these capabilities
requires one argument: the number of the color. By convention, the first eight colors (07) map to, in
order: black, red, green, yellow, blue, magenta, cyan, white. However, color re-mapping may occur or the
underlying hardware may not support these colors. Mappings for any additional colors supported by the
device (that is, to numbers greater than 7) are at the discretion of the terminfo entry writer.
To initialize a color-pair (HP method), use initp (initialize pair). It requires seven arguments: the
number of a color-pair (range=0 to pairs1), and six RGB values: three for the foreground followed by
three for the background. (Each of these groups of three should be in the order RGB.) When initc or
initp are used, RGB or HLS arguments should be in the order "red, green, blue" or "hue, lightness,
saturation"), respectively. To make a color-pair current, use scp (set color-pair). It takes one argument,
the number of a color-pair.
Some terminals (for example, most color terminal emulators for PCs) erase areas of the screen with current
background color. In such cases, bce (background color erase) should be defined. The variable op (origi-
nal pair) contains a sequence for setting the foreground and the background colors to what they were at the
terminal start-up time. Similarly, oc (original colors) contains a control sequence for setting all colors (for
the Tektronix method) or color-pairs (for the HP method) to the values they had at the terminal start-up
time.
Some color terminals substitute color for video attributes. Such video attributes should not be combined
with colors. Information about these video attributes should be packed into the ncv (no color video) vari-
able. There is a one-to-one correspondence between the nine least significant bits of that variable and the
video attributes. The following table depicts this correspondence.
Bit Decimal Characteristic
Attribute Position Value That Sets
WA_STANDOUT 01sgr, parameter 1
WA_UNDERLINE 12sgr, parameter 2
WA_REVERSE 24sgr, parameter 3
WA_BLINK 38sgr, parameter 4
WA_DIM 416sgr, parameter 5
WA_BOLD 532sgr, parameter 6
WA_INVIS 664sgr, parameter 7
WA_PROTECT 7 128 sgr, parameter 8
WA_ALTCHARSET 8 256 sgr, parameter 9
WA_HORIZONTAL 9 512 sgr1, parameter 1
WA_LEFT 10 1024 sgr1, parameter 2
WA_LOW 11 2048 sgr1, parameter 3
WA_RIGHT 12 4096 sgr1, parameter 4
WA_TOP 13 8192 sgr1, parameter 5
WA_VERTICAL 14 16384 sgr1, parameter 6
When a particular video attribute should not be used with colors, set the corresponding ncv bit to 1; other-
wise set it to 0. To determine the information to pack into the ncv variable, add the decimal values
corresponding to those attributes that cannot coexist with colors. For example, if the terminal uses colors
to simulate reverse video (bit number 2 and decimal value 4) and bold (bit number 5 and decimal value 32),
the resulting value for ncv will be 36 (4 + 32).
Section 4344 22 HP-UX Release 11i: December 2000
___
___