background_color(3G)
NAME
background_color − set background color by color table index or color value for painting by clear_view_surface
SYNOPSIS
C Syntax:
void background_color_index(fildes,index);
int fildes,index;
void background_color(fildes,red,green,blue);
int fildes;
float red,green,blue;
FORTRAN77 Syntax:
subroutine background_color_index(fildes,index)
integer*4 fildes,index
subroutine background_color(fildes,red,green,blue)
integer*4 fildes
real red,green,blue
Pascal Syntax:
procedure background_color_index(fildes,index:integer);
procedure background_color(fildes:integer;red,green,blue:real);
DESCRIPTION
INPUT PARAMETERS
fildes Integer file descriptor returned by gopen when an I/O path to a graphic device is opened.
index Integer index into the device color table. Background color is determined by the red, green, and blue values specified at this table location.
red,green,blue Specifies relative intensity of each color when composing the background color. The floating-point value for each color can range from 0 to 1 where 0 and 1 specify minimum and maximum limit, respectively. Monochrome and grayscale devices determine intensity by using the equation:
I = 0.30 * red + 0.59 * green + 0.11 * blue
Discussion
When background color is set by using red, green, and blue parameters, determination of actual output depends on the state of the mode parameter set by shade_mode:
CMAP_NORMAL Default mode if shade_mode has not been called. The color table is searched for an index pointing to the color in RGB space closest to the one specified.
CMAP_MONOTONIC Color values are converted to an intensity determined by 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 a index with the assumption that the color map is set up with a predefined full color state.
If clear_control is set to clear_all_banks, the frame buffer is cleared to zero instead of the background color when clear_view_surface is called.
The background is repainted with the specified index by subsequent clear_view_surface commands. The area to be repainted is selected by clear_control, and can be:
Virtual device coordinate area
Clip rectangle area
Entire display area
Viewport area
If fildes specifies a hardcopy device, the background color cannot be changed.
DEFAULTS
Color index 0 (zero).
SEE ALSO
bank_switch(3G), clear_view_surface(3G), clear_control(3G), define_color_table(3G), inquire_color_table(3G), shade_mode(3G).
Hewlett-Packard Company — HP-UX Release 9.03: April 1994