fglColor(3G) OpenGL Reference fglColor(3G)NAME
fglColor3b, fglColor3d, fglColor3f, fglColor3i, fglColor3s, fglColor3ub,
fglColor3ui, fglColor3us, fglColor4b, fglColor4d, fglColor4f, fglColor4i,
fglColor4s, fglColor4ub, fglColor4ui, fglColor4us, fglColor3bv,
fglColor3dv, fglColor3fv, fglColor3iv, fglColor3sv, fglColor3ubv,
fglColor3uiv, fglColor3usv, fglColor4bv, fglColor4dv, fglColor4fv,
fglColor4iv, fglColor4sv, fglColor4ubv, fglColor4uiv, fglColor4usv - set
the current color
FORTRAN SPECIFICATION
SUBROUTINE fglColor3b( INTEGER*1 red,
INTEGER*1 green,
INTEGER*1 blue )
SUBROUTINE fglColor3d( REAL*4 red,
REAL*4 green,
REAL*4 blue )
SUBROUTINE fglColor3f( REAL*4 red,
REAL*4 green,
REAL*4 blue )
SUBROUTINE fglColor3i( INTEGER*4 red,
INTEGER*4 green,
INTEGER*4 blue )
SUBROUTINE fglColor3s( INTEGER*2 red,
INTEGER*2 green,
INTEGER*2 blue )
SUBROUTINE fglColor3ub( INTEGER*1 red,
INTEGER*1 green,
INTEGER*1 blue )
SUBROUTINE fglColor3ui( INTEGER*4 red,
INTEGER*4 green,
INTEGER*4 blue )
SUBROUTINE fglColor3us( INTEGER*2 red,
INTEGER*2 green,
INTEGER*2 blue )
SUBROUTINE fglColor4b( INTEGER*1 red,
INTEGER*1 green,
INTEGER*1 blue,
INTEGER*1 alpha )
SUBROUTINE fglColor4d( REAL*4 red,
REAL*4 green,
REAL*4 blue,
REAL*4 alpha )
SUBROUTINE fglColor4f( REAL*4 red,
REAL*4 green,
REAL*4 blue,
REAL*4 alpha )
SUBROUTINE fglColor4i( INTEGER*4 red,
INTEGER*4 green,
INTEGER*4 blue,
INTEGER*4 alpha )
SUBROUTINE fglColor4s( INTEGER*2 red,
Page 1
fglColor(3G) OpenGL Reference fglColor(3G)
INTEGER*2 green,
INTEGER*2 blue,
INTEGER*2 alpha )
SUBROUTINE fglColor4ub( INTEGER*1 red,
INTEGER*1 green,
INTEGER*1 blue,
INTEGER*1 alpha )
SUBROUTINE fglColor4ui( INTEGER*4 red,
INTEGER*4 green,
INTEGER*4 blue,
INTEGER*4 alpha )
SUBROUTINE fglColor4us( INTEGER*2 red,
INTEGER*2 green,
INTEGER*2 blue,
INTEGER*2 alpha )
PARAMETERS
red, green, blue
Specify new red, green, and blue values for the current
color.
alpha Specifies a new alpha value for the current color.
Included only in the four-argument fglColor4 commands.
FORTRAN SPECIFICATION
SUBROUTINE fglColor3bv( CHARACTER*8 v )
SUBROUTINE fglColor3dv( CHARACTER*8 v )
SUBROUTINE fglColor3fv( CHARACTER*8 v )
SUBROUTINE fglColor3iv( CHARACTER*8 v )
SUBROUTINE fglColor3sv( CHARACTER*8 v )
SUBROUTINE fglColor3ubv( CHARACTER*256 v )
SUBROUTINE fglColor3uiv( CHARACTER*8 v )
SUBROUTINE fglColor3usv( CHARACTER*8 v )
SUBROUTINE fglColor4bv( CHARACTER*8 v )
SUBROUTINE fglColor4dv( CHARACTER*8 v )
SUBROUTINE fglColor4fv( CHARACTER*8 v )
SUBROUTINE fglColor4iv( CHARACTER*8 v )
SUBROUTINE fglColor4sv( CHARACTER*8 v )
SUBROUTINE fglColor4ubv( CHARACTER*256 v )
SUBROUTINE fglColor4uiv( CHARACTER*8 v )
SUBROUTINE fglColor4usv( CHARACTER*8 v )
PARAMETERS
v Specifies a pointer to an array that contains red, green, blue, and
(sometimes) alpha values.
DESCRIPTION
The GL stores both a current single-valued color index and a current
four-valued RGBA color. fglColor sets a new four-valued RGBA color.
fglColor has two major variants: fglColor3 and fglColor4. fglColor3
Page 2
fglColor(3G) OpenGL Reference fglColor(3G)
variants specify new red, green, and blue values explicitly and set the
current alpha value to 1.0 (full intensity) implicitly. fglColor4
variants specify all four color components explicitly.
fglColor3b, fglColor4b, fglColor3s, fglColor4s, fglColor3i, and
fglColor4i take three or four signed byte, short, or long integers as
arguments. When v is appended to the name, the color commands can take a
pointer to an array of such values.
Current color values are stored in floating-point format, with
unspecified mantissa and exponent sizes. Unsigned integer color
components, when specified, are linearly mapped to floating-point values
such that the largest representable value maps to 1.0 (full intensity),
and 0 maps to 0.0 (zero intensity). Signed integer color components,
when specified, are linearly mapped to floating-point values such that
the most positive representable value maps to 1.0, and the most negative
representable value maps to -1.0. (Note that this mapping does not
convert 0 precisely to 0.0.) Floating-point values are mapped directly.
Neither floating-point nor signed integer values are clamped to the range
[0,1] before the current color is updated. However, color components are
clamped to this range before they are interpolated or written into a
color buffer.
NOTES
The initial value for the current color is (1, 1, 1, 1).
The current color can be updated at any time. In particular, fglColor
can be called between a call to fglBegin and the corresponding call to
fglEnd.
ASSOCIATED GETS
fglGet with argument GL_CURRENT_COLOR
fglGet with argument GL_RGBA_MODE
SEE ALSO
fglIndex
Page 3