public final class GColor extends Object
| Modifier and Type | Field and Description |
|---|---|
static Paint |
BLACK
A color constant representing the color black.
|
static Paint |
BLUE
A color constant representing the color blue.
|
static Paint |
BROWN
A color constant representing the color brown.
|
static Paint |
CYAN
A color constant representing the color cyan.
|
static Paint |
DARK_GRAY
A color constant representing the color black.
|
static Paint |
GRAY
A color constant representing the color black.
|
static Paint |
GREEN
A color constant representing the color black.
|
static Paint |
LIGHT_GRAY
A color constant representing the color black.
|
static Paint |
MAGENTA
A color constant representing the color magenta.
|
static Paint |
ORANGE
A color constant representing the color orange.
|
static Paint |
PINK
A color constant representing the color pink.
|
static Paint |
PURPLE
A color constant representing the color purple.
|
static Paint |
RED
A color constant representing the color red.
|
static Paint |
WHITE
A color constant representing the color white.
|
static Paint |
YELLOW
A color constant representing the color yellow.
|
| Modifier and Type | Method and Description |
|---|---|
static Paint |
brighter(Paint paint)
Returns a new paint that is slightly brighter than the given paint.
|
static Paint |
darker(Paint paint)
Returns a new paint that is slightly darker than the given paint.
|
protected static void |
ensureLegalColorComponent(int rgb) |
static Paint |
makeColor(int r,
int g,
int b)
Returns a new paint with the given RGB components from 0-255.
|
static Paint |
makeColor(int a,
int r,
int g,
int b)
Returns a new paint with the given ARGB components from 0-255.
|
static void |
matchColor(Paint src,
Paint dst)
Modifies dst to have the same ARGB values as src.
|
static Paint |
random()
Returns a randomly chosen color.
|
public static final Paint BLACK
public static final Paint BLUE
public static final Paint BROWN
public static final Paint CYAN
public static final Paint DARK_GRAY
public static final Paint GRAY
public static final Paint GREEN
public static final Paint LIGHT_GRAY
public static final Paint MAGENTA
public static final Paint ORANGE
public static final Paint PINK
public static final Paint PURPLE
public static final Paint RED
public static final Paint WHITE
public static final Paint YELLOW
public static Paint brighter(Paint paint)
NullPointerException - if paint is nullpublic static Paint darker(Paint paint)
NullPointerException - if paint is nullpublic static Paint makeColor(int a, int r, int g, int b)
IllegalArgumentException - if any of a/r/g/b is not between 0-255public static Paint makeColor(int r, int g, int b)
IllegalArgumentException - if any of r/g/b is not between 0-255public static void matchColor(Paint src, Paint dst)
public static Paint random()
protected static void ensureLegalColorComponent(int rgb)