Porting Color, Shading, and Writemask Code

When porting color, shading, and writemask code to OpenGL, keep the following points in mind: