To see Fr. Chris' Java source code, click
ColorMixer is a simple applet to help
pick a color in Java, showing the various arguments
needed to make a new Color.
The Color constructors
are a good example of overloading. You can make a new
instance of Color by using one of several constructor methods.
- One takes 3 integers (the Red-Green-Blue from 0 to 255)
- another takes 3 float values (percentage from 0.0F to 1.0F)
- another takes a single hex value (from 0x000000 to 0xFFFFFF)
- yet another takes a single integer value (from 0 to 166-1, aka 224-1, aka 16777215)