#include <curses.h>
init_color(Color, R, G, B) register short Color, R, G, B;
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.
Note: The values for the red, green, and blue components must be between 0 (no component) and 1000 (maximum amount of component). The init_color subroutine sets values less than 0 to 0 and values greater than 1000 to 1000.
To determine if you can change a terminal's color definitions, see the can_change_color subroutine.
OK | Indicates the color was changed successfully. |
ERR | Indicates the color was not changed. |
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);
This subroutine is part of Base Operating System (BOS) Runtime.
Curses Overview for Programming and Manipulating Video Attributes in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.