public class RGBA
extends java.lang.Object
Constructor and Description |
---|
RGBA(float red,
float green,
float blue,
float alpha)
Creates a new RGBA object from the color components in range from 0 to 1 floats.
|
RGBA(int color)
Creates a new RGBA object from a color integer
|
RGBA(int red,
int green,
int blue,
int alpha)
Creates a new RGBA object from the color components in range from 0 to 255 integers.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlpha()
Get alpha component in range from 0 to 255
|
float |
getAlphaComponent()
Get alpha component in range from 0 to 1
|
int |
getBlue()
Get blue component in range from 0 to 255
|
float |
getBlueComponent()
Get blue component in range from 0 to 1
|
int |
getColor()
Get the integer (hex) representation of this color
|
int |
getGreen()
Get green component in range from 0 to 255
|
float |
getGreenComponent()
Get green component in range from 0 to 1
|
int |
getRed()
Get red component in range from 0 to 255
|
float |
getRedComponent()
Get red component in range from 0 to 1
|
void |
glColor()
Calls
GL11.glColor4f(float, float, float, float) to color something with gl |
java.lang.String |
toString() |
public RGBA(int color)
color
- hex code of color e.g. 0xFFFFFFFF for whitepublic RGBA(int red, int green, int blue, int alpha)
red
- Red componentgreen
- Green componentblue
- Blue componentalpha
- Alpha componentpublic RGBA(float red, float green, float blue, float alpha)
red
- Red componentgreen
- Green componentblue
- Blue componentalpha
- Alpha componentpublic int getRed()
public int getGreen()
public int getBlue()
public int getAlpha()
public float getRedComponent()
public float getGreenComponent()
public float getBlueComponent()
public float getAlphaComponent()
public int getColor()
public void glColor()
GL11.glColor4f(float, float, float, float)
to color something with glpublic java.lang.String toString()
toString
in class java.lang.Object