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