Class ColorRGBA
- java.lang.Object
-
- WildMagic.LibFoundation.Mathematics.ColorRGBA
-
- All Implemented Interfaces:
java.io.Serializable
public class ColorRGBA extends java.lang.Object implements java.io.SerializableColorRGBA. Red, Green, Blue, Alpha. The components are intended to be in the interval [0,1]- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description floatAAlpha component [0,1]floatBBlue component [0,1]static ColorRGBABLACKConstant ColorRGBA: Black (0,0,0,1)floatGGreen component [0,1]static ColorRGBAINVALIDConstant ColorRGBA: Invalid color (-1,-1,-1,-1)floatRRed component [0,1]private static longserialVersionUIDstatic ColorRGBAWHITEConstant ColorRGBA: White (1,1,1,1)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidClamp()Transform the color channels to [0,1].voidCopy(ColorRGBA rkC)Copy.booleanequals(java.lang.Object kObject)inthashCode()voidScaleByMax()Transform the color channels to [0,1].voidSet(float fR, float fG, float fB, float fA)Sets the R,G,B values of this ColorRGB The components are intended to be in the interval [0,1].java.lang.StringtoString()Returns a string representation of the vector values.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
BLACK
public static final ColorRGBA BLACK
Constant ColorRGBA: Black (0,0,0,1)
-
WHITE
public static final ColorRGBA WHITE
Constant ColorRGBA: White (1,1,1,1)
-
INVALID
public static final ColorRGBA INVALID
Constant ColorRGBA: Invalid color (-1,-1,-1,-1)
-
R
public float R
Red component [0,1]
-
G
public float G
Green component [0,1]
-
B
public float B
Blue component [0,1]
-
A
public float A
Alpha component [0,1]
-
-
Constructor Detail
-
ColorRGBA
public ColorRGBA()
Construction. The components are intended to be in the interval [0,1]. Default construction initial values (0,0,0,1)
-
ColorRGBA
public ColorRGBA(ColorRGBA rkC)
Construction. The components are intended to be in the interval [0,1].- Parameters:
rkC- value from rkC are copied into this.
-
ColorRGBA
public ColorRGBA(float fR, float fG, float fB, float fA)Construction. The components are intended to be in the interval [0,1].- Parameters:
fR- red valuefG- green valuefB- blue valuefA- alpha value
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representation of the vector values.- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation of the vector values.
-
Clamp
public void Clamp()
Transform the color channels to [0,1]. Clamp sets negative values to zero and values larger than one to one. ScaleByMax assumes the color channels are nonnegative, finds the maximum color channel, and divides all channels by that value.
-
Copy
public void Copy(ColorRGBA rkC)
Copy. The components are intended to be in the interval [0,1].- Parameters:
rkC- value from rkC are copied into this.
-
equals
public boolean equals(java.lang.Object kObject)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
ScaleByMax
public void ScaleByMax()
Transform the color channels to [0,1]. Clamp sets negative values to zero and values larger than one to one. ScaleByMax assumes the color channels are nonnegative, finds the maximum color channel, and divides all channels by that value.
-
Set
public void Set(float fR, float fG, float fB, float fA)Sets the R,G,B values of this ColorRGB The components are intended to be in the interval [0,1].- Parameters:
fR- red valuefG- green valuefB- blue valuefA- alpha value
-
-