PenColorGL Function Example

Details

Action

Mathwright32 makes use of 2^32 (approximately 16 Million colors) in drawing and painting routines such as: pencolor, fillcolor, pagecolor, background, etc. Whenever one of these needs a color, pass color(R,G,B) where R, G, and B are integers between 0 and 255, denoting the intensity of Red, Green and Blue, respectively. Certain functions and commands require the list form of argument, others accept also numbers between 0 and 15 (or the constant names of colors, like red).

PenColorGL is a convenience function that translates a number between 0 and 15 to its RGB encoding as a list.

pencolorgl(red);

returns the list (128 0 0). This is what would be returned by:

color(128,0,0);