Changes a color definition.
Curses Library (libcurses.a)
The init_color subroutine changes a color definition. A single color is defined by the combination of its red, green, and blue components. The init_color subroutine changes all the occurrences of the color on the screen immediately. If the color is changed successfully, this subroutines returns OK. Otherwise, it returns ERR.
To determine if you can change a terminal's color definitions, see the can_change_color subroutine.
Item | Description |
---|---|
OK | Indicates the color was changed successfully. |
ERR | Indicates the color was not changed. |
Item | Description |
---|---|
Color | Identifies the color to change. The value of the parameter must be between 0 and COLORS-1. |
R | Specifies the desired intensity of the red component. |
G | Specifies the desired intensity of the green component. |
B | Specifies the desired intensity of the blue component. |
To initialize the color definition for color 11 to violet on a terminal that supports at least 12 colors, use:
init_color(11,500,0,500);