It changes the current drawing color to blue.

Pen Color

Think of the Graphics object as being like a sheet of paper, some colored pens, and some drawing methods. Use the following to change the color of the paper:

setBackground( Color.something )

Use the following method of the Graphics object to change the pen color:

setColor( Color.something )

For example, if gr is a reference to the Graphics object, then this changes the pen color to blue:

gr.setColor( );

Several million colors are possible, but for now, use the pre-defined colors:     Color.yellow    Color.magenta    Color.white
Color.gray    Color.darkGray   Color.lightGray

These are static values from the class Color. (Look at the documentation under Color to see how to set other colors.)


What happened to purple?