Class Color
This Class Allows To Have A Alpha Value To Be Set And Wraps Around A Vector3f To Include Alpha As Well.
Inheritance
java.lang.Object
Color
Syntax
public class Color extends Vector3f
Constructors
Color(float red, float green, float blue)
Declaration
public Color(float red, float green, float blue)
Parameters
Type |
Name |
Description |
float |
red |
|
float |
green |
|
float |
blue |
|
Color(float red, float green, float blue, float alpha)
Declaration
public Color(float red, float green, float blue, float alpha)
Parameters
Type |
Name |
Description |
float |
red |
|
float |
green |
|
float |
blue |
|
float |
alpha |
|
Color(String hex)
Declaration
Parameters
Type |
Name |
Description |
String |
hex |
|
Color(String hex, float alpha)
Declaration
public Color(String hex, float alpha)
Parameters
Type |
Name |
Description |
String |
hex |
|
float |
alpha |
|
Color(Vector3f colorInVector3f)
Declaration
public Color(Vector3f colorInVector3f)
Parameters
Type |
Name |
Description |
Vector3f |
colorInVector3f |
|
Color(Vector3f colorInVector3f, float alpha)
Declaration
public Color(Vector3f colorInVector3f, float alpha)
Parameters
Type |
Name |
Description |
Vector3f |
colorInVector3f |
|
float |
alpha |
|
Fields
DEFAULT_COLOR
Declaration
public static final Color DEFAULT_COLOR= new Color(1.0f, 1.0f, 1.0f, 1.0f)
Field Value
Type |
Description |
final Color |
|
SIZEOF
Declaration
public static final int SIZEOF= 4
Field Value
Type |
Description |
final int |
|
Methods
getAlpha()
Declaration
Returns
getBlue()
Declaration
Returns
getGreen()
Declaration
Returns
getRed()
Declaration
Returns
hex2Rgb(String colorStr)
Declaration
public static Color hex2Rgb(String colorStr)
Parameters
Type |
Name |
Description |
String |
colorStr |
e.g. "#FFFFFF"\ Beware if you are using this for any open gl functions the value needs to be normalized see Vector3f normalize.
|
Returns
normalize()
Declaration
Returns
setAlpha(float alpha)
Declaration
public void setAlpha(float alpha)
Parameters
Type |
Name |
Description |
float |
alpha |
|
setBlue(float blue)
Declaration
public void setBlue(float blue)
Parameters
Type |
Name |
Description |
float |
blue |
|
setGreen(float green)
Declaration
public void setGreen(float green)
Parameters
Type |
Name |
Description |
float |
green |
|
setRed(float red)
Declaration
public void setRed(float red)
Parameters
Type |
Name |
Description |
float |
red |
|