public class RGBColor
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static RGBColor |
BLACK |
static RGBColor |
BLUE |
static RGBColor |
GREEN |
static RGBColor |
RED |
static RGBColor |
WHITE |
Constructor and Description |
---|
RGBColor()
Creates a new, black color.
|
RGBColor(int r,
int g,
int b)
Creates a new color.
|
RGBColor(int r,
int g,
int b,
int a)
Creates a new color with alpha.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlpha()
Returns the alpha value (0..255).
|
int |
getARGB()
Returns the color as an int argb value with alpha.
|
int |
getBlue()
Returns the blue value (0..255).
|
int |
getGreen()
Returns the green value (0..255).
|
float |
getNormalizedAlpha()
Returns the alpha value in normalized form (0..1).
|
float |
getNormalizedBlue()
Returns the blue value in normalized form (0..1).
|
float |
getNormalizedGreen()
Returns the green value in normalized form (0..1).
|
float |
getNormalizedRed()
Returns the red value in normalized form (0..1).
|
int |
getRed()
Returns the red value (0..255).
|
int |
getRGB()
Returns the color as an int rgb value.
|
void |
setTo(int r,
int g,
int b,
int a)
Modifies and existing instance of RGBColor.
|
public static final RGBColor BLACK
public static final RGBColor WHITE
public static final RGBColor RED
public static final RGBColor GREEN
public static final RGBColor BLUE
public RGBColor()
public RGBColor(int r, int g, int b)
r
- red value between 0 and 255g
- green value between 0 and 255b
- blue value between 0 and 255public RGBColor(int r, int g, int b, int a)
r
- red value between 0 and 255g
- green value between 0 and 255b
- blue value between 0 and 255a
- alpha value between 0 and 255public void setTo(int r, int g, int b, int a)
r
- red value between 0 and 255g
- green value between 0 and 255b
- blue value between 0 and 255a
- alpha value between 0 and 255public float getNormalizedRed()
public float getNormalizedGreen()
public float getNormalizedBlue()
public float getNormalizedAlpha()
public int getRed()
public int getBlue()
public int getGreen()
public int getAlpha()
public int getRGB()
public int getARGB()