The type parameter specifies the data type of each color component and stride gives the byte stride from one color to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. When a color array is specified, size , type , stride , and pointer are saved as client side state. If enabled, the color array is used when glDrawArrays , glDrawElements or glArrayElement is called. Use glDrawElements to draw nonsequential elements from prespecified arrays. Use glArrayElement to draw individual elements.
Parameters size Specifies the number of components per color.
It must be 3 or 4. The initial value is 0. The glColorPointer subroutine is available only if the GL version is 1.1 or greater. The color array is initially disabled and it won't be accessed when glArrayElement , glDrawElements , or glDrawArrays is called. Execution of glColorPointer is not allowed between glBegin and the corresponding glEnd , but an error may or may not be generated.