Top Description Fields Constructors Methods
javax.vecmath

public Class Color3f

extends Tuple3f
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.awt.Color

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.

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from javax.vecmath.Tuple3f:
xyz

Constructor Summary

AccessConstructor and Description
public
Color3f(float
the red color value
x
,
float
the green color value
y
,
float
the blue color value
z
)

Constructs and initializes a Color3f from the three xyz values.

public
Color3f(float[]
the array of length 3 containing xyz in order
v
)

Constructs and initializes a Color3f from the array of length 3.

public
Color3f(Color3f
the Color3f containing the initialization x y z data
v1
)

Constructs and initializes a Color3f from the specified Color3f.

public
Color3f(Tuple3f
the Tuple3f containing the initialization x y z data
t1
)

Constructs and initializes a Color3f from the specified Tuple3f.

public
Color3f(Tuple3d
the Tuple3d containing the initialization x y z data
t1
)

Constructs and initializes a Color3f from the specified Tuple3d.

public
Color3f(Color
the AWT color with which to initialize this Color3f object
color
)

Constructs and initializes a Color3f from the specified AWT Color object.

public
Color3f()

Constructs and initializes a Color3f to (0.0, 0.0, 0.0).

Method Summary

Modifier and TypeMethod and Description
public final Color

Returns:

a new AWT Color object
get
()

Returns a new AWT color object initialized with the r,g,b values of this Color3f object.

public final void
set(Color
the AWT color to copy into this Color3f object
color
)

Sets the r,g,b values of this Color3f object to those of the specified AWT Color object.

Inherited from javax.vecmath.Tuple3f:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetXgetYgetZhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetXsetYsetZsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple3f.serialVersionUID.

Constructor Detail

Color3fback to summary
public Color3f(float x, float y, float z)

Constructs and initializes a Color3f from the three xyz values.

Parameters
x:float

the red color value

y:float

the green color value

z:float

the blue color value

Color3fback to summary
public Color3f(float[] v)

Constructs and initializes a Color3f from the array of length 3.

Parameters
v:float[]

the array of length 3 containing xyz in order

Color3fback to summary
public Color3f(Color3f v1)

Constructs and initializes a Color3f from the specified Color3f.

Parameters
v1:Color3f

the Color3f containing the initialization x y z data

Color3fback to summary
public Color3f(Tuple3f t1)

Constructs and initializes a Color3f from the specified Tuple3f.

Parameters
t1:Tuple3f

the Tuple3f containing the initialization x y z data

Color3fback to summary
public Color3f(Tuple3d t1)

Constructs and initializes a Color3f from the specified Tuple3d.

Parameters
t1:Tuple3d

the Tuple3d containing the initialization x y z data

Color3fback to summary
public Color3f(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:Color

the AWT color with which to initialize this Color3f object

Since
vecmath 1.2
Color3fback to summary
public Color3f()

Constructs and initializes a Color3f to (0.0, 0.0, 0.0).

Method Detail

getback to summary
public final Color get()

Returns a new AWT color object initialized with the r,g,b values of this Color3f object.

Returns:Color

a new AWT Color object

Since
vecmath 1.2
setback to summary
public final void set(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:Color

the AWT color to copy into this Color3f object

Since
vecmath 1.2