|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 glColor4 commands.|
void glColor3bv( const GLbyte *v )void glColor3dv( const GLdouble *v )void glColor3fv( const GLfloat *v )void glColor3iv( const GLint *v )void glColor3sv( const GLshort *v )void glColor3ubv( const GLubyte *v )void glColor3uiv( const GLuint *v )void glColor3usv( const GLushort *v )void glColor4bv( const GLbyte *v )void glColor4dv( const GLdouble *v )void glColor4fv( const GLfloat *v )void glColor4iv( const GLint *v )void glColor4sv( const GLshort *v )void glColor4ubv( const GLubyte *v )void glColor4uiv( const GLuint *v )void glColor4usv( const GLushort *v )
v Specifies a pointer to an array that contains red, green, blue, and (sometimes) alpha values.
The GL stores both a current single-valued color index and a current four-valued RGBA color. glColor sets a new four-valued RGBA color. glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly and set the current alpha value to 1.0 (full intensity) implicitly. glColor4 variants specify all four color components explicitly.
glColor3b, glColor4b, glColor3s, glColor4s, glColor3i, and glColor4i 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.
The initial value for the current color is (1, 1, 1, 1).
The current color can be updated at any time. In particular, glColor can be called between a call to glBegin and the corresponding call to glEnd.
glGet with argument GL_CURRENT_COLOR
glGet with argument GL_RGBA_MODE