public final class ColorRGB
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static ColorRGB |
BLACK |
static ColorRGB |
BLUE |
static ColorRGB |
GRAY |
static ColorRGB |
GREEN |
static ColorRGB |
RED |
static ColorRGB |
WHITE |
static ColorRGB |
YELLOW |
| Constructor and Description |
|---|
ColorRGB(int r,
int g,
int b)
Creates a color from the specified red, green, and blue components.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
getB() |
int |
getG() |
int |
getR() |
int |
hashCode() |
static ColorRGB |
parseHex(java.lang.String hex)
Parses a color from hexadecimal notation.
|
java.lang.String |
toHex()
Returns this color in hexidecimal notation.
|
java.lang.String |
toString() |
public static final ColorRGB BLACK
public static final ColorRGB WHITE
public static final ColorRGB GRAY
public static final ColorRGB RED
public static final ColorRGB GREEN
public static final ColorRGB BLUE
public static final ColorRGB YELLOW
public ColorRGB(int r,
int g,
int b)
java.lang.IllegalArgumentException - if one of the color components is outside
the range 0-255.public int getR()
public int getG()
public int getB()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toHex()
public static ColorRGB parseHex(java.lang.String hex)
java.lang.IllegalArgumentException - if hex is not a valid color.