public class LibgdxColor extends java.lang.Object implements Color
Modifier and Type | Field and Description |
---|---|
com.badlogic.gdx.graphics.Color |
color |
Constructor and Description |
---|
LibgdxColor(byte r,
byte g,
byte b,
byte a) |
LibgdxColor(com.badlogic.gdx.graphics.Color color) |
LibgdxColor(float r,
float g,
float b,
float a) |
LibgdxColor(int rgba8888) |
LibgdxColor(int r,
int g,
int b,
int a) |
Modifier and Type | Method and Description |
---|---|
float |
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
|
float |
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)
|
float |
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 |
float |
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 |
public LibgdxColor(int rgba8888)
public LibgdxColor(int r, int g, int b, int a)
public LibgdxColor(float r, float g, float b, float a)
public LibgdxColor(byte r, byte g, byte b, byte a)
public LibgdxColor(com.badlogic.gdx.graphics.Color color)
public Color set(float r, float g, float b, float a)
Color
public Color set(byte r, byte g, byte b, byte a)
Color
public Color add(float r, float g, float b, float a)
Color
Color
public Color add(byte r, byte g, byte b, byte a)
Color
Color
public Color multiply(float r, float g, float b, float a)
Color
Color
by the given RGBA componentspublic Color multiply(byte r, byte g, byte b, byte a)
Color
Color
by the given RGBA componentspublic Color multiply(float multiplier)
Color
Color
by the given multiplierpublic Color subtract(float r, float g, float b, float a)
Color
Color
public Color subtract(byte r, byte g, byte b, byte a)
Color
Color
public Color lerp(Color color, float t)
Color
public Color lerp(float r, float g, float b, float a, float t)
Color
lerp
in interface Color
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 chainingpublic Color lerp(byte r, byte g, byte b, byte a, float t)
Color
lerp
in interface Color
r
- The red component of the target Color
(A value between 0 and 255)g
- The green component of the target Color
(A value between 0 and 255)b
- The blue component of the target Color
(A value between 0 and 255)a
- The alpha component of the target Color
(A value between 0 and 255)t
- The interpolation coefficientColor
for chainingpublic float getRAsFloat()
Color
Color
getRAsFloat
in interface Color
public float getGAsFloat()
Color
Color
getGAsFloat
in interface Color
public float getBAsFloat()
Color
Color
getBAsFloat
in interface Color
public float getAAsFloat()
Color
Color
getAAsFloat
in interface Color
public byte getRAsByte()
Color
Color
getRAsByte
in interface Color
public byte getGAsByte()
Color
Color
getGAsByte
in interface Color
public byte getBAsByte()
Color
Color
getBAsByte
in interface Color
public byte getAAsByte()
Color
Color
getAAsByte
in interface Color
public void setR(float r)
Color
public void setG(float g)
Color
public void setB(float b)
Color
public void setA(float a)
Color
public float rf()
rf
in interface Color
Color.getRAsFloat()
public float gf()
gf
in interface Color
Color.getGAsFloat()
public float bf()
bf
in interface Color
Color.getBAsFloat()
public float af()
af
in interface Color
Color.getAAsFloat()
public float rb()
rb
in interface Color
Color.getRAsByte()
public float gb()
gb
in interface Color
Color.getGAsByte()
public float bb()
bb
in interface Color
Color.getBAsByte()
public float ab()
ab
in interface Color
Color.getAAsByte()
public int argb8888()
Color
public int rgba8888()
Color
public int rgba4444()
Color
public int rgb888()
Color
public int rgb565()
Color
public int bgr565()
Color