In RGBA mode, use the glColor*() command to select a current color.
void glColor3{b s i f d ub us ui} (TYPEr, TYPEg, TYPEb);
void glColor4{b s i f d ub us ui} (TYPEr, TYPEg, TYPEb, TYPEa);
void glColor3{b s i f d ub us ui}v (const TYPE*v);
void glColor4{b s i f d ub us ui}v (const TYPE*v);
Sets the current red, green, blue, and alpha values. This command can have up to three suffixes, which differentiate variations of the parameters accepted. The first suffix is either 3 or 4, to indicate whether you supply an alpha value in addition to the red, green, and blue values. If you don't supply an alpha value, it's automatically set to 1.0. The second suffix indicates the data type for parameters: byte, short, integer, float, double, unsigned byte, unsigned short, or unsigned integer. The third suffix is an optional v, which indicates that the argument is a pointer to an array of values of the given data type.
For the versions of glColor*() that accept floating-point data types, the values should typically range between 0.0 and 1.0, the minimum and maximum values that can be stored in the framebuffer. (Values ouside the range [0,1] are clamped to the range [0,1] when used directly, but aren't clamped when used to modify lighting material parameters.) 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 zero 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 (see Table 5-1 ). Floating-point values are mapped directly. Neither floating-point nor signed-integer values are clamped to the range [0,1] before updating the current color. However, color components are clamped to this range before they are interpolated or written into a color buffer.
| Suffix | Data Type | Minimum Value | Min Value Maps to | Maximum Value | Max Value Maps to |
|---|---|---|---|---|---|
b | 1-byte integer | -128 | -1.0 | 127 | 1.0 |
s | 2-byte integer | -32,768 | -1.0 | 32,767 | 1.0 |
i | 4-byte integer | -2,147,483,648 | -1.0 | 2,147,483,647 | 1.0 |
ub | unsigned 1-byte integer | 0 | 0.0 | 255 | 1.0 |
us | unsigned 2-byte integer | 0 | 0.0 | 65,535 | 1.0 |
ui | unsigned 4-byte integer | 0 | 0.0 | 4,294,967,295 | 1.0 |
OpenGL Programming Guide