Package javax.vecmath
Class Color4f
java.lang.Object
javax.vecmath.Tuple4f
javax.vecmath.Color4f
- All Implemented Interfaces:
Serializable
,Cloneable
A four-element color represented by single precision floating point
x, y, z, and w values. The x, y, z, and w values represent the red,
blue, green, and alpha color values, respectively. Color and alpha
components should be in the range [0.0, 1.0].
Java 3D assumes that a linear (gamma-corrected) visual is used for all colors.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionColor4f()
Constructs and initializes a Color4f to (0.0, 0.0, 0.0, 0.0).Color4f
(float[] c) Constructs and initializes a Color4f from the array of length 4.Color4f
(float x, float y, float z, float w) Constructs and initializes a Color4f from the specified xyzw coordinates.Constructs and initializes a Color4f from the specified AWT Color object.Constructs and initializes a Color4f from the specified Color4f.Constructs and initializes a Color4f from the specified Tuple4d.Constructs and initializes a Color4f from the specified Tuple4f. -
Method Summary
Methods inherited from class javax.vecmath.Tuple4f
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, getW, getX, getY, getZ, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setW, setX, setY, setZ, sub, sub, toString
-
Constructor Details
-
Color4f
public Color4f(float x, float y, float z, float w) Constructs and initializes a Color4f from the specified xyzw coordinates.- Parameters:
x
- the red color valuey
- the green color valuez
- the blue color valuew
- the alpha value
-
Color4f
public Color4f(float[] c) Constructs and initializes a Color4f from the array of length 4.- Parameters:
c
- the array of length 4 containing r,g,b,a in order
-
Color4f
Constructs and initializes a Color4f from the specified Color4f.- Parameters:
c1
- the Color4f containing the initialization r,g,b,a data
-
Color4f
Constructs and initializes a Color4f from the specified Tuple4f.- Parameters:
t1
- the Tuple4f containing the initialization r,g,b,a data
-
Color4f
Constructs and initializes a Color4f from the specified Tuple4d.- Parameters:
t1
- the Tuple4d containing the initialization r,g,b,a data
-
Color4f
Constructs and initializes a Color4f from the specified AWT Color object. No conversion is done on the color to compensate for gamma correction.- Parameters:
color
- the AWT color with which to initialize this Color4f object- Since:
- vecmath 1.2
-
Color4f
public Color4f()Constructs and initializes a Color4f to (0.0, 0.0, 0.0, 0.0).
-
-
Method Details
-
set
Sets the r,g,b,a values of this Color4f object to those of the specified AWT Color object. No conversion is done on the color to compensate for gamma correction.- Parameters:
color
- the AWT color to copy into this Color4f object- Since:
- vecmath 1.2
-
get
Returns a new AWT color object initialized with the r,g,b,a values of this Color4f object.- Returns:
- a new AWT Color object
- Since:
- vecmath 1.2
-