public class Color
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static Color |
BLACK
The color black.
|
static Color |
BLUE
The color blue.
|
static Color |
CYAN
The color cyan.
|
static Color |
DARKGRAY
The color dark gray.
|
static Color |
GREEN
The color green.
|
static Color |
LIGHTGRAY
The color light gray.
|
static Color |
MAGENTA
The color magenta.
|
static Color |
ORANGE
The color orange.
|
static Color |
PINK
The color pink.
|
static Color |
RED
The color red.
|
static Color |
TRANSPARENT
The identifier for 'transparent'-color
|
static Color |
WHITE
The color white.
|
static Color |
YELLOW
The color yellow.
|
| Constructor and Description |
|---|
Color(int rgb)
Creates a new color from an integer value.
|
Color(int r,
int g,
int b)
Creates a new color with specified red, green, and blue values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
getBlue()
Returns the blue component value of this color.
|
int |
getGreen()
Returns the green component value of this color.
|
int |
getRed()
Returns the red component value of this color.
|
int |
getRgb()
Returns the color as an RGB value.
|
int |
hashCode() |
java.lang.String |
toString() |
public static final Color BLACK
public static final Color BLUE
public static final Color GREEN
public static final Color CYAN
public static final Color RED
public static final Color MAGENTA
public static final Color YELLOW
public static final Color WHITE
public static final Color DARKGRAY
public static final Color LIGHTGRAY
public static final Color ORANGE
public static final Color PINK
public static final Color TRANSPARENT
public Color(int rgb)
rgb - an integer representation for a colorpublic Color(int r,
int g,
int b)
r - the red component valueg - the green component valueb - the blue component valuepublic boolean equals(java.lang.Object o)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public int getBlue()
public int getGreen()
public int getRed()
public int getRgb()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()