Returns the current intensity of the red, green, and blue (RGB) components of a color.
#include <curses.h> color_content(Color, R, G, B) short Color; short *R, *G, *B;
The color_content subroutine, given a color number, returns the current intensity of its red, green, and blue (RGB) components. This subroutine stores the information in the address specified by the R, G, and B arguments. If successful, this returns OK. Otherwise, this subroutine returns ERR if the color does not exist, is outside the valid range, or the terminal cannot change its color definitions.
To determine if you can change the color definitions for a terminal, use the can_change_color subroutine. You must call the start_color subroutine before you can call the color_content subroutine.
Note: The values stored at the addresses pointed to by R, G, and B are between 0 (no component) and 1000 (maximum amount of component) inclusive.
OK | Indicates the subroutine was successful. |
ERR | Indicates the color does not exist, is outside the valid range, or the terminal cannot change its color definitions. |
To obtain the RGB component information for color 10 (assuming the terminal supports at least 11 colors), use:
short *r, *g, *b; color_content(10,r,g,b);
This subroutine is part of Base Operating System (BOS) Runtime.
Curses Overview for Programming, Manipulating Video Attributes,
List of Curses Subroutines in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.