Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ line_color(3G) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

define_color_table(3G)

draw(3G)

inquire_color_table(3G)

marker_color(3G)

perimeter_color(3G)

polyline(3G)

shade_mode(3G)

text_color(3G)

line_color(3G)

NAME

line_color − select color index or color value for subsequent line primitives. 

SYNOPSIS

C Syntax:

void line_color_index(fildes,index)
int fildes,index;

void line_color(fildes,red,green,blue)
int fildes;
float red,green,blue;

FORTRAN77 Syntax:

subroutine line_color_index(fildes,index)
integer*4 fildes,index;

subroutine line_color(fildes,red,green,blue)
integer*4 fildes;
real red,green,blue;

Pascal Syntax:

procedure line_color_index(fildes,index:integer);

procedure line_color(fildes:integer;red,green,blue:real);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when the I/O path to the output graphic device is opened. 

index Integer index into the device color table.  The line 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
are the color values (in the range of 0.0 to 1.0) to be used for subsequent line primitives. Zero (0.0) indicates no color and one (1.0) indicates full color.  Monochrome and grayscale devices use the equation
I=0.30(red)+0.59(green)+0.11(blue)
to determine the intensity.

Discussion

The draw and polyline primitives are affected by this procedure. 

When the line color is set by using red, green, and blue parameters, determination of the actual output dependends 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 that points to the color in RGB space that most closely matches the one specified.  Specification by index is faster than color map searches. 

CMAP_MONOTONIC Color values are converted to intensity by using the equation:
I = 0.30(red) + 0.59(green) + 0.11(blue). 
This intensity is then 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 to a predefined full color state. 

If the color map is changed after this procedure is called, the line color used may not be the original color desired. 

Color can also be specified in the polyline vertex list.  See vertex_format(3G) or polyline_with_data3d(3G) for details.

If the index is out of range, a warning is generated and a mod function is performed. 

DEFAULTS

The default line color is the color defined in the current color map at index 1.  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. 

SEE ALSO

define_color_table(3G), draw(3G), inquire_color_table(3G), marker_color(3G),
perimeter_color(3G), polyline(3G), shade_mode(3G), text_color(3G).

Hewlett-Packard Company  —  HP-UX Release 9.10: April 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026