public interface Color
Modifier and Type | Method and Description |
---|---|
byte |
ab() |
Color |
add(byte r,
byte g,
byte b,
byte a)
Adds RGBA components to this
Color |
Color |
add(Color color)
|
Color |
add(float r,
float g,
float b,
float a)
Adds RGBA components to this
Color |
float |
af() |
int |
argb8888()
Returns the color value in ARGB8888 format
|
byte |
bb() |
float |
bf() |
int |
bgr565()
Returns the color value in BGR565 format
|
int |
bgra4444()
Returns the color value in BGR4444 format
|
Color |
copy()
|
boolean |
equals(Color color)
|
byte |
gb() |
byte |
getAAsByte()
Returns the alpha component of this
Color |
float |
getAAsFloat()
Returns the alpha component of this
Color |
byte |
getBAsByte()
Returns the blue component of this
Color |
float |
getBAsFloat()
Returns the blue component of this
Color |
byte |
getGAsByte()
Returns the green component of this
Color |
float |
getGAsFloat()
Returns the green component of this
Color |
byte |
getRAsByte()
Returns the red component of this
Color |
float |
getRAsFloat()
Returns the red component of this
Color |
float |
gf() |
Color |
lerp(byte r,
byte g,
byte b,
byte a,
float t)
Linearly interpolates between this color and the target color by t
|
Color |
lerp(Color color,
float t)
Linearly interpolates between this color and the target color by t
|
Color |
lerp(float r,
float g,
float b,
float a,
float t)
Linearly interpolates between this color and the target color by t
|
Color |
multiply(byte r,
byte g,
byte b,
byte a)
Multiplies this
Color by the given RGBA components |
Color |
multiply(Color color)
|
Color |
multiply(float multiplier)
Multiplies this
Color by the given multiplier |
Color |
multiply(float r,
float g,
float b,
float a)
Multiplies this
Color by the given RGBA components |
byte |
rb() |
float |
rf() |
int |
rgb565()
Returns the color value in RGB565 format
|
int |
rgb888()
Returns the color value in RGB888 format
|
int |
rgba4444()
Returns the color value in RGBA4444 format
|
int |
rgba8888()
Returns the color value in RBGA8888 format
|
Color |
set(byte r,
byte g,
byte b,
byte a)
Sets the RGBA components
|
Color |
set(Color color)
|
Color |
set(float r,
float g,
float b,
float a)
Sets the RGBA components
|
void |
setA(byte a) |
void |
setA(float a)
Sets the alpha component
|
void |
setB(byte b) |
void |
setB(float b)
Sets the blue component
|
void |
setG(byte g) |
void |
setG(float g)
Sets the green component
|
void |
setR(byte r) |
void |
setR(float r)
Sets the red component
|
Color |
subtract(byte r,
byte g,
byte b,
byte a)
Subtracts RGBA components from this
Color |
Color |
subtract(Color color)
|
Color |
subtract(float r,
float g,
float b,
float a)
Subtracts RGBA components from this
Color |
Color set(float r, float g, float b, float a)
r
- The red component (between 0.0 and 1.0)g
- The green component (between 0.0 and 1.0)b
- The blue component (between 0.0 and 1.0)a
- The alpha component (between 0.0 and 1.0)Color
for chainingColor set(byte r, byte g, byte b, byte a)
r
- The red component (between -128 and 127 (inclusive))g
- The green component (between -128 and 127 (inclusive))b
- The blue component (between -128 and 127 (inclusive))a
- The alpha component (between -128 and 127 (inclusive))Color
for chainingColor add(float r, float g, float b, float a)
Color
r
- The red component (between 0.0 and 1.0)g
- The green component (between 0.0 and 1.0)b
- The blue component (between 0.0 and 1.0)a
- The alpha component (between 0.0 and 1.0)Color
for chainingColor add(byte r, byte g, byte b, byte a)
Color
r
- The red component (between -128 and 127 (inclusive))g
- The green component (between -128 and 127 (inclusive))b
- The blue component (between -128 and 127 (inclusive))a
- The alpha component (between -128 and 127 (inclusive))Color
for chainingColor multiply(float r, float g, float b, float a)
Color
by the given RGBA componentsr
- The red component (between 0.0 and 1.0)g
- The green component (between 0.0 and 1.0)b
- The blue component (between 0.0 and 1.0)a
- The alpha component (between 0.0 and 1.0)Color
for chainingColor multiply(byte r, byte g, byte b, byte a)
Color
by the given RGBA componentsr
- The red component (between -128 and 127 (inclusive))g
- The green component (between -128 and 127 (inclusive))b
- The blue component (between -128 and 127 (inclusive))a
- The alpha component (between -128 and 127 (inclusive))Color
for chainingColor multiply(float multiplier)
Color
by the given multipliermultiplier
- The value to multiply the RGBA components byColor
for chainingColor subtract(float r, float g, float b, float a)
Color
r
- The red component (between 0.0 and 1.0)g
- The green component (between 0.0 and 1.0)b
- The blue component (between 0.0 and 1.0)a
- The alpha component (between 0.0 and 1.0)Color
for chainingColor subtract(byte r, byte g, byte b, byte a)
Color
r
- The red component (between -128 and 127 (inclusive))g
- The green component (between -128 and 127 (inclusive))b
- The blue component (between -128 and 127 (inclusive))a
- The alpha component (between -128 and 127 (inclusive))Color
for chainingColor lerp(Color color, float t)
Color lerp(float r, float g, float b, float a, float t)
r
- The red component of the target Color
(A value between 0.0. and 1.0)g
- The green component of the target Color
(A value between 0.0. and 1.0)b
- The blue component of the target Color
(A value between 0.0. and 1.0)a
- The alpha component of the target Color
(A value between 0.0. and 1.0)t
- The interpolation coefficientColor
for chainingColor lerp(byte r, byte g, byte b, byte a, float t)
r
- The red component of the target Color
(A value between -128 and 127 (inclusive))g
- The green component of the target Color
(A value between -128 and 127 (inclusive))b
- The blue component of the target Color
(A value between -128 and 127 (inclusive))a
- The alpha component of the target Color
(A value between -128 and 127 (inclusive))t
- The interpolation coefficientColor
for chainingfloat getRAsFloat()
Color
float getGAsFloat()
Color
float getBAsFloat()
Color
float getAAsFloat()
Color
byte getRAsByte()
Color
byte getGAsByte()
Color
byte getBAsByte()
Color
byte getAAsByte()
Color
void setR(float r)
r
- A value between 0f and 1fvoid setG(float g)
g
- A value between 0f and 1fvoid setB(float b)
b
- A value between 0f and 1fvoid setA(float a)
a
- A value between 0f and 1fvoid setR(byte r)
void setG(byte g)
void setB(byte b)
void setA(byte a)
boolean equals(Color color)
color
- The Color
to compare tofloat rf()
getRAsFloat()
float gf()
getGAsFloat()
float bf()
getBAsFloat()
float af()
getAAsFloat()
byte rb()
getRAsByte()
byte gb()
getGAsByte()
byte bb()
getBAsByte()
byte ab()
getAAsByte()
int argb8888()
int rgba8888()
int rgba4444()
int rgb888()
int rgb565()
int bgr565()
int bgra4444()