javax.media.ding3d.vecmath
Class Color3f

java.lang.Object
  extended by javax.media.ding3d.vecmath.Tuple3f
      extended by javax.media.ding3d.vecmath.Color3f
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Color3f
extends Tuple3f
implements java.io.Serializable

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:
Serialized Form

Field Summary
 
Fields inherited from class javax.media.ding3d.vecmath.Tuple3f
x, y, z
 
Constructor Summary
Color3f()
          Constructs and initializes a Color3f to (0.0, 0.0, 0.0).
Color3f(java.awt.Color color)
          Constructs and initializes a Color3f from the specified AWT Color object.
Color3f(Color3f v1)
          Constructs and initializes a Color3f from the specified Color3f.
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.
Color3f(Tuple3d t1)
          Constructs and initializes a Color3f from the specified Tuple3d.
Color3f(Tuple3f t1)
          Constructs and initializes a Color3f from the specified Tuple3f.
 
Method Summary
 java.awt.Color get()
          Returns a new AWT color object initialized with the r,g,b values of this Color3f object.
 void set(java.awt.Color color)
          Sets the r,g,b values of this Color3f object to those of the specified AWT Color object.
 
Methods inherited from class javax.media.ding3d.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
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Color3f

public Color3f(float x,
               float y,
               float z)
Constructs and initializes a Color3f from the three xyz values.

Parameters:
x - the red color value
y - the green color value
z - 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

public Color3f(Color3f v1)
Constructs and initializes a Color3f from the specified Color3f.

Parameters:
v1 - the Color3f containing the initialization x y z data

Color3f

public Color3f(Tuple3f t1)
Constructs and initializes a Color3f from the specified Tuple3f.

Parameters:
t1 - the Tuple3f containing the initialization x y z data

Color3f

public Color3f(Tuple3d t1)
Constructs and initializes a Color3f from the specified Tuple3d.

Parameters:
t1 - the Tuple3d containing the initialization x y z data

Color3f

public Color3f(java.awt.Color color)
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 Detail

set

public final void set(java.awt.Color color)
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

public final java.awt.Color 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