The OpenGL Color Model

OpenGL uses the additive RGB color model, which works with just the three primary colors: red, green, and blue. Many colors can be created by mixing these primary colors together in various proportions. For example, red and green together create yellow, red and blue together create magenta, and blue and green together create cyan. Add red, green, and blue together and you get white (as seen in the following figure).

images/AddingColor/OpenGlColorModel.png
Figure 12. The RGB additive color model

This model works differently than the subtractive paint model you might have learned about in school: in the subtractive paint model, adding blue and yellow makes green, ...

Get OpenGL ES 2 for Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.