Description:
To use these routines, start_color() must be called, usually
- immediately after initscr(). Colors are always used in pairs,
- referred to as color-pairs. A color-pair consists of a
- foreground color and a background color. A color-pair is
- initialized via init_pair(). After initialization, COLOR_PAIR(n)
+ immediately after initscr(). Colors are always used in pairs,
+ referred to as color-pairs. A color-pair consists of a
+ foreground color and a background color. A color-pair is
+ initialized via init_pair(). After initialization, COLOR_PAIR(n)
can be used like any other video attribute.
start_color() initializes eight basic colors (black, red, green,
maximum number of colors and color-pairs the terminal is capable
of displaying).
- init_pair() changes the definition of a color-pair. It takes
- three arguments: the number of the color-pair to be redefined,
- and the new values of the foreground and background colors. The
- pair number must be between 0 and COLOR_PAIRS - 1, inclusive.
- The foreground and background must be between 0 and COLORS - 1,
- inclusive. If the color pair was previously initialized, the
- screen is refreshed, and all occurrences of that color-pair are
+ init_pair() changes the definition of a color-pair. It takes
+ three arguments: the number of the color-pair to be redefined,
+ and the new values of the foreground and background colors. The
+ pair number must be between 0 and COLOR_PAIRS - 1, inclusive.
+ The foreground and background must be between 0 and COLORS - 1,
+ inclusive. If the color pair was previously initialized, the
+ screen is refreshed, and all occurrences of that color-pair are
changed to the new definition.
- has_colors() indicates if the terminal supports, and can
+ has_colors() indicates if the terminal supports, and can
maniplulate color. It returns TRUE or FALSE.
can_change_color() indicates if the terminal has the capability
_normalize(&fg, &bg);
- /* To allow the PDC_PRESERVE_SCREEN option to work, we only reset
- curscr if this call to init_pair() alters a color pair created by
+ /* To allow the PDC_PRESERVE_SCREEN option to work, we only reset
+ curscr if this call to init_pair() alters a color pair created by
the user. */
if (pair_set[pair])
return PDC_color_content(color, red, green, blue);
else
{
- /* Simulated values for platforms that don't support palette
+ /* Simulated values for platforms that don't support palette
changing */
short maxval = (color & 8) ? 1000 : 680;