Changes a color-pair definition.
Curses Library (libcurses.a)
The init_pair subroutine changes a color-pair definition. A color pair is a combination of a foreground and a background color. If you specify a color pair that was previously initialized, curses refreshes the screen and changes all occurrences of that color pair to the new definition. You must call the start_color subroutine before you call this subroutine.
Item | Description |
---|---|
OK | Indicates successful completion. |
ERR | Indicates the subroutine failed. |
Item | Description |
---|---|
Pair | Identifies the color-pair number. The value of the Pair parameter must be between 1 and COLORS_PAIRS-1. |
F | Specifies the foreground color number. This number must be between 0 and COLORS-1. |
B | Specifies the background color number. This number must be between 0 and COLORS-1. |
To initialize the color definition for color-pair 2 to a black foreground (color 0) with a cyan background (color 3), use:
init_pair(2,COLOR_BLACK, COLOR_CYAN);