public class Color
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Color |
black |
static Color |
BLACK |
static Color |
blue |
static Color |
BLUE |
static Color |
cyan |
static Color |
CYAN |
static Color |
DARK_GRAY |
static Color |
darkGray |
static Color |
gray |
static Color |
GRAY |
static Color |
green |
static Color |
GREEN |
static Color |
LIGHT_GRAY |
static Color |
lightGray |
static Color |
magenta |
static Color |
MAGENTA |
static Color |
orange |
static Color |
ORANGE |
static Color |
pink |
static Color |
PINK |
static Color |
red |
static Color |
RED |
static Color |
white |
static Color |
WHITE |
static Color |
yellow |
static Color |
YELLOW |
Constructor and Description |
---|
Color(Color color) |
Color(int value) |
Color(int value,
boolean hasalpha) |
Color(int r,
int g,
int b) |
Color(int r,
int g,
int b,
int a) |
Modifier and Type | Method and Description |
---|---|
Color |
brighter() |
Color |
darker() |
static Color |
decode(java.lang.String nm) |
boolean |
equals(java.lang.Object obj) |
int |
getAlpha() |
int |
getBlue() |
static Color |
getColor(java.lang.String nm) |
static Color |
getColor(java.lang.String nm,
Color v) |
static Color |
getColor(java.lang.String nm,
int v) |
static Color |
getColorAt(java.lang.Integer colorIndex)
Returns the
Color associated to the provided index. |
int |
getGreen() |
static java.util.List<Color> |
getIndexedColors() |
static Color |
getRandomColor() |
static Color |
getRandomColor(java.util.Random random)
Returns a
Color object generated using 3 calls to the provided Random object. |
int |
getRed() |
int |
getRGB() |
int |
hashCode() |
static int |
indexOf(Color color)
Searches for the color index associated with the current
Color . |
void |
testColorValueRange(float r,
float g,
float b,
float a) |
void |
testColorValueRange(int r,
int g,
int b,
int a) |
public static Color white
public static Color WHITE
public static Color lightGray
public static Color LIGHT_GRAY
public static Color gray
public static Color GRAY
public static Color darkGray
public static Color DARK_GRAY
public static Color black
public static Color BLACK
public static Color red
public static Color RED
public static Color pink
public static Color PINK
public static Color orange
public static Color ORANGE
public static Color yellow
public static Color YELLOW
public static Color green
public static Color GREEN
public static Color magenta
public static Color MAGENTA
public static Color cyan
public static Color CYAN
public static Color blue
public static Color BLUE
public Color(int r, int g, int b, int a)
public Color(int r, int g, int b)
public Color(int value)
public Color(int value, boolean hasalpha)
public Color(Color color)
public int getRed()
public int getGreen()
public int getBlue()
public int getAlpha()
public int getRGB()
public static java.util.List<Color> getIndexedColors()
public void testColorValueRange(int r, int g, int b, int a)
public void testColorValueRange(float r, float g, float b, float a)
public static Color decode(java.lang.String nm) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static Color getColor(java.lang.String nm)
public static Color getColor(java.lang.String nm, int v)
public Color brighter()
public Color darker()
public static Color getColorAt(java.lang.Integer colorIndex)
public static int indexOf(Color color)
Searches for the color index associated with the current Color
.
color
- the Color
to be searched for.-1
if not found.public static Color getRandomColor(java.util.Random random)
Returns a Color
object generated using 3 calls to the provided Random
object.
If the provided random is null, the result of getRandomColor()
is returned.
random
- a Random
object to be used. Can be null.Color
object.public static Color getRandomColor()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object