java.awt.Color (JDK 1.0)
The Color object describes a color. The Color() constructors describe a color as red, green, and blue components between 0 and 255, or as floating-point values between 0.0 and 1.0. The class method Color.getHSBColor() creates a color using the hue/saturation/brightness color model.
brighter() and darker() are useful methods to create shading effects. The getColor() methods look up a color name in the properties database and convert the resulting integer color value into a Color object. Two of these methods provide a default value to be used in case the specified color name is not found.
public classColorextends Object implements Serializable { //Public ConstructorspublicColor(intr, intg, intb); publicColor(intrgb); publicColor(floatr, floatg, floatb); //Constantspublic static final Colorblack; public static final Colorblue; public static final Colorcyan; public static final ColordarkGray; public static final Colorgray; public static final Colorgreen; public static final ColorlightGray; public static final Colormagenta; public static final Colororange; public static final Colorpink; public static final Colorred; public static final Colorwhite; public static final Coloryellow; //Class Methodspublic static intHSBtoRGB(floathue, floatsaturation, floatbrightness); public static float[]RGBtoHSB(intr, intg, intb, float[]hsbvals); 1.1 public static Colordecode(Stringnm) throws NumberFormatException; public static ColorgetColor(Stringnm); public static ColorgetColor(Stringnm, Colorv); public static ColorgetColor(Stringnm, intv); public static ColorgetHSBColor(floath, floats, floatb); //Public Instance Methodspublic Colorbrighter(); public Colordarker(); public booleanequals(Objectobj); //Overrides Objectpublic intgetBlue(); public intgetGreen(); public intgetRGB(); public intgetRed(); public inthashCode(); //Overrides Objectpublic StringtoString(); //Overrides Object}
Extended By:
SystemColor
Passed To:
Color.getColor(), Component.setBackground(), Component.setForeground(), ComponentPeer.setBackground(), ComponentPeer.setForeground(), Graphics.drawImage(), Graphics.setColor(), Graphics.setXORMode()
Returned By:
Color.brighter(), Color.darker(), Color.decode(), Color.getColor(), Color.getHSBColor(), Component.getBackground(), Component.getForeground(), Graphics.getColor()
Type Of:
Color.black, Color.blue, Color.cyan, Color.darkGray, Color.gray, Color.green, Color.lightGray, Color.magenta, Color.orange, Color.pink, Color.red, Color.white, Color.yellow