Top Description Fields Constructors Methods
javax.vecmath

public Class Color4f

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

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.

Field Summary

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

Constructor Summary

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

Constructs and initializes a Color4f from the specified xyzw coordinates.

public
Color4f(float[]
the array of length 4 containing r,g,b,a in order
c
)

Constructs and initializes a Color4f from the array of length 4.

public
Color4f(Color4f
the Color4f containing the initialization r,g,b,a data
c1
)

Constructs and initializes a Color4f from the specified Color4f.

public
Color4f(Tuple4f
the Tuple4f containing the initialization r,g,b,a data
t1
)

Constructs and initializes a Color4f from the specified Tuple4f.

public
Color4f(Tuple4d
the Tuple4d containing the initialization r,g,b,a data
t1
)

Constructs and initializes a Color4f from the specified Tuple4d.

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

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

public
Color4f()

Constructs and initializes a Color4f to (0.0, 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,a values of this Color4f object.

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

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

Inherited from javax.vecmath.Tuple4f:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetWgetXgetYgetZhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetWsetXsetYsetZsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple4f.serialVersionUID.

Constructor Detail

Color4fback to summary
public Color4f(float x, float y, float z, float w)

Constructs and initializes a Color4f from the specified xyzw coordinates.

Parameters
x:float

the red color value

y:float

the green color value

z:float

the blue color value

w:float

the alpha value

Color4fback to summary
public Color4f(float[] c)

Constructs and initializes a Color4f from the array of length 4.

Parameters
c:float[]

the array of length 4 containing r,g,b,a in order

Color4fback to summary
public Color4f(Color4f c1)

Constructs and initializes a Color4f from the specified Color4f.

Parameters
c1:Color4f

the Color4f containing the initialization r,g,b,a data

Color4fback to summary
public Color4f(Tuple4f t1)

Constructs and initializes a Color4f from the specified Tuple4f.

Parameters
t1:Tuple4f

the Tuple4f containing the initialization r,g,b,a data

Color4fback to summary
public Color4f(Tuple4d t1)

Constructs and initializes a Color4f from the specified Tuple4d.

Parameters
t1:Tuple4d

the Tuple4d containing the initialization r,g,b,a data

Color4fback to summary
public Color4f(Color color)

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:Color

the AWT color with which to initialize this Color4f object

Since
vecmath 1.2
Color4fback to summary
public Color4f()

Constructs and initializes a Color4f to (0.0, 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,a values of this Color4f 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,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:Color

the AWT color to copy into this Color4f object

Since
vecmath 1.2