Colors

The java.awt.Color class defines a number of constant color values:

	Color.black	   Color.green		Color.red
	Color.blue	   Color.lightGray	Color.white
	Color.cyan	   Color.magenta	Color.yellow
	Color.darkGray	   Color.orange	
	Color.gray	   Color.pink

To create a Color object, you must specify the red, green, and blue components (RGB) of the desired color. These must be floats between 0.0 and 1.0, where they normally are between 0 and 255.


Back to Lecture3