Chapter 4. Color
After reading this chapter, you’ll be able to do the following:
• Decide between using RGBA or color-index mode for your application
• Specify desired colors for drawing objects
• Use smooth shading to draw a single polygon with more than one color
In OpenGL Version 3.1, many of the techniques and functions described in this chapter were removed through deprecation. In particular, color-index rendering is not supported. The concepts relating to RGBA color modes are still relevant, but need to be implemented in vertex or fragment shaders, as described in Chapter 15.
The goal of almost all OpenGL applications is to draw color pictures in a window on the screen. The window is a rectangular array ...