Name
gl.Color -- set the current color
Synopsis
gl.Color(red, green, blue[, alpha])
Function
The GL stores both a current single-valued color index and a current four-valued RGBA color. gl.Color() sets a new four-valued RGBA color. If the optional alpha argument is omitted, it will be set to 1.0.

Current color values are stored in floating-point format such that the largest representable value maps to 1.0 (full intensity), and 0 maps to 0.0 (zero intensity).

Alternatively, you can also pass a table containing three or four floating-point values specifying the red, green, blue, and alpha values for the color.

The initial value for the current color is (1, 1, 1, 1).

The current color can be updated at any time. In particular, gl.Color() can be called between a call to gl.Begin() and the corresponding call to gl.End().

Please consult an OpenGL reference manual for more information.

Inputs
red
specify new red value for the current color
green
specify new green value for the current color
blue
specify new blue value for the current color
alpha
optional: specify new alpha value for the current color (defaults to 1.0)
Associated gets
gl.Get() with argument #GL_CURRENT_COLOR

gl.Get() with argument #GL_RGBA_MODE


Show TOC