public class Color extends Object
The Color interface provide a representation of a color, independant from the target Window Toolkit (AWT, SWT, etc).
Modifier and Type | Field and Description |
---|---|
float |
a |
float |
b |
static Color |
BLACK
Black color.
|
static Color |
BLUE
Blue color.
|
static Color[] |
COLORS |
static Color |
CYAN
Cyan color.
|
float |
g |
static Color |
GRAY
Gray color.
|
static Color |
GREEN
Green color.
|
static Color |
MAGENTA
Magenta color.
|
float |
r |
static Color |
RED
Red color.
|
static Random |
rng |
static Color |
WHITE
White color.
|
static Color |
YELLOW
Yellow color.
|
Constructor and Description |
---|
Color(float r,
float g,
float b)
Initialize a color with an alpha channel set to 1.
|
Color(float r,
float g,
float b,
float a)
Initialize a color with values between 0 and 1.
|
Color(int r,
int g,
int b)
Initialize a color with an alpha channel set to 255.
|
Color(int r,
int g,
int b,
int a)
Initialize a color with values between 0 and 255.
|
Modifier and Type | Method and Description |
---|---|
Color |
alphaSelf(float alpha) |
Color |
clone() |
static Color |
color(int c)
Returns one of the main color based on id.
|
void |
mul(Color factor) |
Color |
negative() |
Color |
negativeSelf() |
static Color |
random() |
float[] |
toArray() |
String |
toHex()
Return the hexadecimal representation of this color.
|
String |
toString() |
public static final Color BLACK
public static final Color WHITE
public static final Color GRAY
public static final Color RED
public static final Color GREEN
public static final Color BLUE
public static final Color YELLOW
public static final Color MAGENTA
public static final Color CYAN
public static final Color[] COLORS
public static Random rng
public float r
public float g
public float b
public float a
public Color(float r, float g, float b)
public Color(int r, int g, int b)
public Color(float r, float g, float b, float a)
public Color(int r, int g, int b, int a)
public void mul(Color factor)
public Color alphaSelf(float alpha)
public String toHex()
public float[] toArray()
public Color negative()
public Color negativeSelf()
public static Color random()
public static Color color(int c)
Copyright © 2016. All rights reserved.