public final class Color
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Color.ColorRangeException |
| Modifier and Type | Field and Description |
|---|---|
static Color |
black
Black color.
|
static Color |
blue
Blue color.
|
static Color |
cyan
Cyan color.
|
static Color |
darkGray
Dark gray color.
|
static Color |
gray
Gray color.
|
static Color |
green
Green color.
|
static Color |
lightGray
Light gray color.
|
static Color |
magenta
Magenta color.
|
static Color |
orange
Orange color.
|
static Color |
pink
Pink color.
|
static Color |
red
Red color.
|
static Color |
white
White color.
|
static Color |
yellow
Yellow color.
|
| Modifier and Type | Method and Description |
|---|---|
Color |
add(Color color)
Performs addition operation.
|
int |
alpha() |
Color |
alpha(int alpha)
Creates Color instance with replaced alpha component.
|
float |
alphaf() |
Color |
alphaf(float alpha)
Creates Color instance with replaced alpha component.
|
int |
argb() |
static Color |
argb(int argb)
Creates Color instance out of packed ARGB data.
|
Color |
average(Color color)
Performs average operation.
|
Color |
blend(Color color)
Performs alpha color blending.
|
int |
blue() |
Color |
blue(int blue)
Creates Color instance with replaced blue component.
|
float |
bluef() |
Color |
bluef(float blue)
Creates Color instance with replaced blue component.
|
Color |
complementary()
Calculates complementary color to this color instance.
|
Color |
divide(Color color)
Performs division operation.
|
boolean |
equals(java.lang.Object obj) |
int |
green() |
Color |
green(int green)
Creates Color instance with replaced green component.
|
float |
greenf() |
Color |
greenf(float green)
Creates Color instance with replaced green component.
|
int |
hashCode() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
hsl()
Getter for HSL components.
|
static Color |
hsl(double h,
double s,
double l)
Creates Color instance from HSL color format.
|
static Color |
hsl(org.apache.commons.math3.geometry.euclidean.threed.Vector3D hsl)
Creates Color instance from HSL color format using vector as source of components.
|
float |
hue() |
Color |
hue(float h) |
float |
lighting() |
Color |
lighting(float l) |
Color |
multiply(Color color)
Performs multiplication operation.
|
Color |
negate()
Performs negation operation.
|
int |
red() |
Color |
red(int red)
Creates Color instance with replaced red component.
|
float |
redf() |
Color |
redf(float red)
Creates Color instance with replaced red component.
|
static Color |
rgb(int rgb)
Creates Color instance out of packed RGB data.
|
static Color |
rgb(int red,
int green,
int blue)
Creates Color instance out of integer components.
|
int |
rgba() |
static Color |
rgba(int rgba)
Creates Color instance out of packed RGBA data.
|
static Color |
rgba(int rgb,
int alpha)
Creates Color instance out of packed RGB data and byte alpha component.
|
static Color |
rgba(int red,
int green,
int blue,
int alpha)
Creates Color instance out of integer components.
|
static Color |
rgbac(int rgb,
int alpha)
Creates Color instance out of packed RGB data and byte alpha component.
|
static Color |
rgbac(int red,
int green,
int blue,
int alpha)
Creates Color instance out of integer components.
|
static Color |
rgbaf(double red,
double green,
double blue,
double alpha)
Creates Color instance out of double components.
|
static Color |
rgbaf(int rgb,
float alpha)
Creates Color instance out of packed RGB data and double alpha component.
|
static Color |
rgbafc(double red,
double green,
double blue,
double alpha)
Creates Color instance out of double components.
|
static Color |
rgbafc(int rgb,
float alpha)
Creates Color instance out of packed RGB data and double alpha component.
|
static Color |
rgbc(int red,
int green,
int blue)
Creates Color instance out of integer components.
|
static Color |
rgbf(double red,
double green,
double blue)
Creates Color instance out of double components.
|
static Color |
rgbfc(double red,
double green,
double blue)
Creates Color instance out of double components.
|
float |
saturation() |
Color |
saturation(float s) |
Color |
subtract(Color color)
Performs subtraction operation.
|
public static final Color white
public static final Color lightGray
public static final Color gray
public static final Color darkGray
public static final Color black
public static final Color red
public static final Color pink
public static final Color orange
public static final Color yellow
public static final Color green
public static final Color magenta
public static final Color cyan
public static final Color blue
public static Color rgbc(int red, int green, int blue)
red - component.green - component.blue - component.public static Color rgb(int red, int green, int blue)
red - component.green - component.blue - component.Color.ColorRangeException - if component variables are out of 0-255 range.public static Color rgbfc(double red, double green, double blue)
red - component.green - component.blue - component.public static Color rgbf(double red, double green, double blue)
red - component.green - component.blue - component.Color.ColorRangeException - if component variables are out of 0-1 range.public static Color rgb(int rgb)
rgb - data occupying lower 24bits.public static Color rgbac(int red, int green, int blue, int alpha)
red - component.green - component.blue - component.alpha - component.Color.ColorRangeException - if component variables are out of 0-255 range.public static Color rgba(int red, int green, int blue, int alpha)
red - component.green - component.blue - component.alpha - component.Color.ColorRangeException - if component variables are out of 0-255 range.public static Color rgbafc(double red, double green, double blue, double alpha)
red - component.green - component.blue - component.alpha - component.public static Color rgbaf(double red, double green, double blue, double alpha)
red - component.green - component.blue - component.alpha - component.Color.ColorRangeException - if component variables are out of 0-1 range.public static Color rgbac(int rgb, int alpha)
rgb - packed into lower 24bits.alpha - will be clamped into 0-255 range.public static Color rgba(int rgb, int alpha)
rgb - packed into lower 24bits.alpha - component.Color.ColorRangeException - if alpha component is out of 0-255 range.public static Color rgbafc(int rgb, float alpha)
rgb - packed into lower 24bits.alpha - will be clamped into 0-1 range.public static Color rgbaf(int rgb, float alpha)
rgb - packed into lower 24bits.alpha - component.Color.ColorRangeException - if alpha component is out of 0-1 range.public static Color argb(int argb)
argb - packed into 32bits.public static Color rgba(int rgba)
rgba - packed into 32bits.public static Color hsl(double h, double s, double l)
h - component.s - component.l - component.public static Color hsl(org.apache.commons.math3.geometry.euclidean.threed.Vector3D hsl)
hsl - vector which components will be used as HSL color components.
X -> H,
Y -> S,
Z -> Lpublic int argb()
public int rgba()
public int red()
public int green()
public int blue()
public int alpha()
public Color red(int red)
red - a new red component.public Color green(int green)
green - a new green component.public Color blue(int blue)
blue - a new blue component.public Color alpha(int alpha)
alpha - a new alpha component.public float redf()
public float greenf()
public float bluef()
public float alphaf()
public Color redf(float red)
red - a new red component.public Color greenf(float green)
green - a new green component.public Color bluef(float blue)
blue - a new blue component.public Color alphaf(float alpha)
alpha - a new alpha component.public Color blend(Color color)
color - color to blend with.public Color add(Color color)
color - color to be added.public Color subtract(Color color)
color - color to be subtracted.public Color multiply(Color color)
color - color to be multiplied.public Color divide(Color color)
color - color to be divisor.public Color average(Color color)
color - color to second part of the average.public Color negate()
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D hsl()
public float lighting()
public float saturation()
public float hue()
public Color lighting(float l)
public Color saturation(float s)
public Color hue(float h)
public Color complementary()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object