Signature
glColor(
*
args
)
glColor*f* -- convenience function to dispatch on argument type dispatches to glColor3f, glColor2f, glColor4f, glColor3f, glColor2f, glColor4f depending on the arguments passed...
Parameters
Variables | Description |
---|---|
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.
|
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.
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
.
(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
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).
Associated Gets
glGet
with argument
GL_CURRENT_COLOR
glGet
with argument
GL_RGBA_MODE
See Also
Copyright
Copyright
1991-2006
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
http://oss.sgi.com/projects/FreeB/
.
Sample Code References
The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.
glColor
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/OpenGLComponent.py
Lines: 461, 473
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Examples/OpenGL/MiniExamples/OpenGLComponent.py
Lines: 33, 45
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Examples/OpenGL/Checkers/CheckersBoard.py
Lines: 45, 47
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Examples/OpenGL/Checkers/CheckersPiece.py
Lines: 52, 54, 57
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/OpenGLComponent.py
Lines: 458, 470
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Examples/Checkers/CheckersBoard.py
Lines: 45, 47
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Examples/Checkers/CheckersPiece.py
Lines: 52, 54, 57
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/OpenGLComponent.py
Lines: 461, 473
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/OpenGL/MiniExamples/OpenGLComponent.py
Lines: 33, 45
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/OpenGL/Checkers/CheckersBoard.py
Lines: 45, 47
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/OpenGL/Checkers/CheckersPiece.py
Lines: 52, 54, 57
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/OpenGLComponent.py
Lines: 458, 470
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Examples/Checkers/CheckersBoard.py
Lines: 45, 47
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Examples/Checkers/CheckersPiece.py
Lines: 52, 54, 57
glColor3d
glColor3dv
glColor3f
OpenGLContext
tests/nehe5.py
Lines: 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 77, 82, 87, 92, 97, 102
OpenGL-Demo
PyOpenGL-Demo/NeHe/lesson5.py
Lines: 100, 102, 104, 107, 109, 111, 114, 116, 118, 122, 124, 126, 137, 143, 149, 155, 161, 167
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 848
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube_controlled.py
Lines: 128, 134, 140, 146, 152, 158
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube.py
Lines: 66, 72, 78, 84, 90, 96
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/PygameWrapperPlane.py
Lines: 79
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/Display3D.py
Lines: 537
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 870
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/Old/SoC/simplecube.py
Lines: 103, 109, 115, 121, 127, 133
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/simplecube/simplecube_controlled.py
Lines: 127, 133, 139, 145, 151, 157
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 847
glColor3fv
glColor3ub
glColor4f
{LGPL} PyMT
pymt/graphx/draw.py
Lines: 361, 364, 367, 370, 473, 475, 477, 487, 497, 507, 539, 541, 543, 545
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/Visualisation/PhysicsGraph3D/Particles3D.py
Lines: 492, 571, 616
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 111, 142
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/SkyGrassBackground.py
Lines: 66, 71
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/SimpleCube.py
Lines: 74, 81, 88, 95, 102, 109
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/SimpleButton.py
Lines: 108, 130
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 160
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 111, 142
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/SkyGrassBackground.py
Lines: 66, 71
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/SimpleCube.py
Lines: 74, 81, 88, 95, 102, 109
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/ArrowButton.py
Lines: 71, 90
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/SimpleButton.py
Lines: 108, 130
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/Scrollbar3D.py
Lines: 173, 181, 198, 206, 228, 240
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/SimpleCube.py
Lines: 143, 149, 155, 161, 167, 173
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/Object3D.py
Lines: 127, 133, 139, 145, 151, 157
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/ProgressBar.py
Lines: 66, 103
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/SkyGrassBackground.py
Lines: 48, 53
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/SimpleCube.py
Lines: 52, 58, 64, 70, 76, 82
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Visualisation/PhysicsGraph3D/Particles3D.py
Lines: 492, 571, 616
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 160
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 111, 142
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/SkyGrassBackground.py
Lines: 66, 71
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/SimpleCube.py
Lines: 74, 81, 88, 95, 102, 109
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Button.py
Lines: 146
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/ArrowButton.py
Lines: 71, 90
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/SimpleButton.py
Lines: 108, 130
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Label.py
Lines: 121
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/3D/playground/SimpleCube.py
Lines: 52, 58, 64, 70, 76, 82
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 160
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 111, 142
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/SkyGrassBackground.py
Lines: 66, 71
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/SimpleCube.py
Lines: 74, 81, 88, 95, 102, 109
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Button.py
Lines: 146
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/ArrowButton.py
Lines: 71, 90
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/SimpleButton.py
Lines: 108, 130
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Label.py
Lines: 121
glColor4ub
glColor4ubv