|
G. Palmer, 1797 T. Young, 1801
Ewald Hering, 1878
Y = 0.299R + 0.587G + 0.114B
I = 0.596R - 0.274G - 0.322B
Q = 0.211R - 0.523G + 0.896B
Y = 0.299R + 0.587G + 0.114B
Dr = -0.450R - 0.883G + 1.333B = 3.059U
Db = -1.333R + 1.116G - 0.217B = -2.169V
|
glColor3f( 1.0, 0.0, 0.0 ); //full red, no green, no blue
glBegin( GL_POINT );
|
So, if H = 600, we have a color of a mixture of red and green ( i.e. yellow )
If R > G > B, and are in [0, 1]
| H = | G - B
R - B |
x 60 |
| L = | Max + Min
2 |
| S = | Max - Min
Max + Min |
if Max + Min ≤ 1 |
and
| S = | Max - Min
2 - (Max + Min) |
if Max + Min ≥ 1 |
In RGBA mode, the hardware sets aside a certain number of bitplanes each of the R, G, B, and A components
16 bit-planes, 4 bit-planes for each color
Example: if a system has 8-bits for R component,
Dithering
glEnable ( GL_DITHER );
glDisable( GL_DITHER );
Use glColor*() to specify a color.
| Index | Red | Green | Blue |
|---|---|---|---|
| 0 | |||
| 1 | |||
| 2 | |||
| 3 | |||
| . | |||
| . | |||
| 255 |
Specifying a color in RGBA mode:
A line or a filled polygon primitive can be drawn with a single color (flat shading) or with many different colors (smooth shading, also called Gouraud shading).
| void glShadeModel (GLenum mode); |
| Sets the shading model. The mode parameter can be either GL_SMOOTH (the default) or GL_FLAT. |
|
![]() |