color, colorf - sets the color index in the current draw mode
c expects an index into the current color map.
color sets the color index of the currently active GL framebuffer, one of
normal, popup, overlay, or underlay (see drawmode). The current
framebuffer must be in color map mode (see cmode) for the color command
to be applicable. Most drawing commands copy the current color index
into the color bitplanes of the current framebuffer. color is retained
in each draw mode, so when a draw mode is re-entered, color is reset to
the last value specified in that draw mode.
color values range from 0 through 2n-1, where n is the number of
bitplanes available in the current draw mode. n can be ascertained by
calling getplanes while in the desired draw mode, or by calling getgdesc
at any time. Color indices larger than 2n-1 are clamped to 2n-1; color
indices less than zero yield undefined results.
The color displayed by a given color index is determined by the current
color map (see mapcolor.) Each draw mode has its own color map.
colorf is similar to color, except that it expects a floating point color
index. Before the color is written into display memory, it is rounded to
the nearest integer value. When dithering is enabled and the hardware
supports it, the extra precision is used in the dithering. Also, when
drawing with the GOURAUD shading model, machines that iterate color
indices with fractional precision yield more precise shading results
using colorf than with color.
It is an error to call color or colorf while the current framebuffer is
in RGB mode.
The color indices of all framebuffers in color map mode are set to zero
when gconfig is called.
drawmode, getcolor, mapcolor, writemask
IRIS-4D B, G, GT, and GTX models do not iterate color with fractional
precision, nor do early serial numbers of the Personal Iris. Use
getgdesc(GD_CIFRACT) to determine whether fractional color index
iteration is supported.
PPPPaaaaggggeeee 2222 [ Back ]