Package info.u_team.u_team_core.util
Klasse RGBA
java.lang.Object
info.u_team.u_team_core.util.RGBA
Basic rgba representation of a color with some conversion methods
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRGBA(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 integerRGBA(int red, int green, int blue, int alpha) Creates a new RGBA object from the color components in range from 0 to 255 integers. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic RGBAfromARGB(int color) Returns anRGBAobject from an argb integer.static RGBAstatic RGBAintgetAlpha()Get alpha component in range from 0 to 255floatGet alpha component in range from 0 to 1intgetBlue()Get blue component in range from 0 to 255floatGet blue component in range from 0 to 1intgetColor()Get the integer (hex) representation of this color in rgba formatintGet the integer (hex) representation of this color in argb formatintgetGreen()Get green component in range from 0 to 255floatGet green component in range from 0 to 1intgetRed()Get red component in range from 0 to 255floatGet red component in range from 0 to 1setAlpha(int alpha) Set the alpha component in range from 0 to 255setAlphaComponent(float alpha) Set the alpha component in range from 0 to 1setBlue(int blue) Set the blue component in range from 0 to 255setBlueComponent(float blue) Set the blue component in range from 0 to 1setGreen(int green) Set the green component in range from 0 to 255setGreenComponent(float green) Set the green component in range from 0 to 1setRed(int red) Set the red component in range from 0 to 255setRedComponent(float red) Set the red component in range from 0 to 1toString()
-
Felddetails
-
BLACK
-
WHITE
-
-
Konstruktordetails
-
RGBA
public RGBA(int color) Creates a new RGBA object from a color integer- Parameter:
color- hex code of color e.g. 0xFFFFFFFF for white
-
RGBA
public 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.- Parameter:
red- Red componentgreen- Green componentblue- Blue componentalpha- Alpha component
-
RGBA
public 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.- Parameter:
red- Red componentgreen- Green componentblue- Blue componentalpha- Alpha component
-
-
Methodendetails
-
getRed
public int getRed()Get red component in range from 0 to 255- Gibt zurück:
- Red component
-
getGreen
public int getGreen()Get green component in range from 0 to 255- Gibt zurück:
- Green component
-
getBlue
public int getBlue()Get blue component in range from 0 to 255- Gibt zurück:
- Blue component
-
getAlpha
public int getAlpha()Get alpha component in range from 0 to 255- Gibt zurück:
- Alpha component
-
getRedComponent
public float getRedComponent()Get red component in range from 0 to 1- Gibt zurück:
- Red component
-
getGreenComponent
public float getGreenComponent()Get green component in range from 0 to 1- Gibt zurück:
- Green component
-
getBlueComponent
public float getBlueComponent()Get blue component in range from 0 to 1- Gibt zurück:
- Blue component
-
getAlphaComponent
public float getAlphaComponent()Get alpha component in range from 0 to 1- Gibt zurück:
- Alpha component
-
getColor
public int getColor()Get the integer (hex) representation of this color in rgba format- Gibt zurück:
- Color as an integer
-
getColorARGB
public int getColorARGB()Get the integer (hex) representation of this color in argb format- Gibt zurück:
- Color as an integer
-
setRed
Set the red component in range from 0 to 255- Parameter:
red- Red component- Gibt zurück:
- A new RGBA instance with the red value set
-
setGreen
Set the green component in range from 0 to 255- Parameter:
green- Green component- Gibt zurück:
- A new RGBA instance with the green value set
-
setBlue
Set the blue component in range from 0 to 255- Parameter:
blue- Blue component- Gibt zurück:
- A new RGBA instance with the blue value set
-
setAlpha
Set the alpha component in range from 0 to 255- Parameter:
alpha- Alpha component- Gibt zurück:
- A new RGBA instance with the alpha value set
-
setRedComponent
Set the red component in range from 0 to 1- Parameter:
red- Red component- Gibt zurück:
- A new RGBA instance with the red value set
-
setGreenComponent
Set the green component in range from 0 to 1- Parameter:
green- Green component- Gibt zurück:
- A new RGBA instance with the green value set
-
setBlueComponent
Set the blue component in range from 0 to 1- Parameter:
blue- Blue component- Gibt zurück:
- A new RGBA instance with the blue value set
-
setAlphaComponent
Set the alpha component in range from 0 to 1- Parameter:
alpha- Alpha component- Gibt zurück:
- A new RGBA instance with the alpha value set
-
toString
-
fromARGB
Returns anRGBAobject from an argb integer. This encoding is used in many minecraft stuff- Parameter:
color- ARBA color- Gibt zurück:
- RGBA object
-
fromRGB
- Parameter:
rgb- RGB object- Gibt zurück:
- RGBA object
-
fromRGB
- Parameter:
rgb- RGB objectalpha- Alpha value between 0 and 255- Gibt zurück:
- RGBA object
-