TEXT_COLOR(3G)
NAME
text_color − select color for subsequent text operations
SYNOPSIS
C Syntax:
void text_color_index(fildes,index);
int fildes,index;
void text_color(fildes,red,green,blue);
int fildes;
float red,green,blue;
FORTRAN77 Syntax:
subroutine text_color_index(fildes,index)
integer*4 fildes,index
subroutine text_color(fildes,red,green,blue)
integer*4 fildes
real red,green,blue
Pascal Syntax:
procedure text_color_index(fildes,index:integer);
procedure text_color(fildes:integer;red,green,blue:real);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
index is an integer index into the device color table. The text color is the red, green, and blue values specified at this table location. The size of the color table may be obtained using the inquire_sizes procedure.
red, green, blue Color values (in the range of 0.0 to 1.0) to be used for subsequent text primitives. Zero (0.0) indicates no color and one (1.0) indicates full color. Monochrome devices use the equation
I = 0.30(red) + 0.59(green) + 0.11(blue)
to determine intensity.
Discussion
To acquire the current color table definition, use the inquire_color_table command. To change the current color table definition, use the define_color_table procedure.
Text primitives are altered by this procedure.
When text color is set using red, green, and blue parameters, determination of actual output depends on the state of the mode parameter set with shade_mode:
CMAP_NORMAL This is the default mode if shade_mode has not been called. The color table is searched for an index which points to the closest color in RGB space to the one specified. Specification by index is more efficient than color map searches.
CMAP_MONOTONIC Color values are converted to intensity using the equation:
I = 0.30(red) + 0.59(green) + 0.11(blue).
This intensity is mapped to an index, using the minimum and maximum defined by shade_range.
CMAP_FULL Color values are mapped directly to an index with the assumption that the color map is set up to a predefined full color state.
If the color map is changed after this procedure is called, the text color used may not be the original color desired.
If the index is out of range, a warning is generated and a mod function is performed.
DEFAULTS
Default text color is the color defined in the current color map at index 1.
SEE ALSO
define_color_table(3G), inquire_color_table(3G), shade_mode(3G), text(3G).
Hewlett-Packard Company — May 11, 2021