1GLCOLOR(3G) OpenGL Manual GLCOLOR(3G)
2
3
4
6 glColor - set the current color
7
9 void glColor3b(GLbyte red, GLbyte green, GLbyte blue);
10
11 void glColor3s(GLshort red, GLshort green, GLshort blue);
12
13 void glColor3i(GLint red, GLint green, GLint blue);
14
15 void glColor3f(GLfloat red, GLfloat green, GLfloat blue);
16
17 void glColor3d(GLdouble red, GLdouble green, GLdouble blue);
18
19 void glColor3ub(GLubyte red, GLubyte green, GLubyte blue);
20
21 void glColor3us(GLushort red, GLushort green, GLushort blue);
22
23 void glColor3ui(GLuint red, GLuint green, GLuint blue);
24
25 void glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
26
27 void glColor4s(GLshort red, GLshort green, GLshort blue,
28 GLshort alpha);
29
30 void glColor4i(GLint red, GLint green, GLint blue, GLint alpha);
31
32 void glColor4f(GLfloat red, GLfloat green, GLfloat blue,
33 GLfloat alpha);
34
35 void glColor4d(GLdouble red, GLdouble green, GLdouble blue,
36 GLdouble alpha);
37
38 void glColor4ub(GLubyte red, GLubyte green, GLubyte blue,
39 GLubyte alpha);
40
41 void glColor4us(GLushort red, GLushort green, GLushort blue,
42 GLushort alpha);
43
44 void glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha);
45
47 red, green, blue
48 Specify new red, green, and blue values for the current color.
49
50 alpha
51 Specifies a new alpha value for the current color. Included only in
52 the four-argument glColor4 commands.
53
55 void glColor3bv(const GLbyte * v);
56
57 void glColor3sv(const GLshort * v);
58
59 void glColor3iv(const GLint * v);
60
61 void glColor3fv(const GLfloat * v);
62
63 void glColor3dv(const GLdouble * v);
64
65 void glColor3ubv(const GLubyte * v);
66
67 void glColor3usv(const GLushort * v);
68
69 void glColor3uiv(const GLuint * v);
70
71 void glColor4bv(const GLbyte * v);
72
73 void glColor4sv(const GLshort * v);
74
75 void glColor4iv(const GLint * v);
76
77 void glColor4fv(const GLfloat * v);
78
79 void glColor4dv(const GLdouble * v);
80
81 void glColor4ubv(const GLubyte * v);
82
83 void glColor4usv(const GLushort * v);
84
85 void glColor4uiv(const GLuint * v);
86
88 v
89 Specifies a pointer to an array that contains red, green, blue, and
90 (sometimes) alpha values.
91
93 The GL stores both a current single-valued color index and a current
94 four-valued RGBA color. glColor sets a new four-valued RGBA color.
95 glColor has two major variants: glColor3 and glColor4. glColor3
96 variants specify new red, green, and blue values explicitly and set the
97 current alpha value to 1.0 (full intensity) implicitly. glColor4
98 variants specify all four color components explicitly.
99
100 glColor3b, glColor4b, glColor3s, glColor4s, glColor3i, and glColor4i
101 take three or four signed byte, short, or long integers as arguments.
102 When v is appended to the name, the color commands can take a pointer
103 to an array of such values.
104
105 Current color values are stored in floating-point format, with
106 unspecified mantissa and exponent sizes. Unsigned integer color
107 components, when specified, are linearly mapped to floating-point
108 values such that the largest representable value maps to 1.0 (full
109 intensity), and 0 maps to 0.0 (zero intensity). Signed integer color
110 components, when specified, are linearly mapped to floating-point
111 values such that the most positive representable value maps to 1.0, and
112 the most negative representable value maps to -1.0. (Note that this
113 mapping does not convert 0 precisely to 0.0.) Floating-point values are
114 mapped directly.
115
116 Neither floating-point nor signed integer values are clamped to the
117 range 0 1 before the current color is updated. However, color
118 components are clamped to this range before they are interpolated or
119 written into a color buffer.
120
122 The initial value for the current color is (1, 1, 1, 1).
123
124 The current color can be updated at any time. In particular, glColor
125 can be called between a call to glBegin() and the corresponding call to
126 glEnd().
127
129 glGet() with argument GL_CURRENT_COLOR
130
131 glGet() with argument GL_RGBA_MODE
132
134 glColorPointer, glIndex(), glSecondaryColor()
135
137 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
138 under the SGI Free Software B License. For details, see
139 http://oss.sgi.com/projects/FreeB/.
140
142 opengl.org
143
144
145
146opengl.org 07/13/2018 GLCOLOR(3G)