Top Description Fields Constructors Methods
javax.vecmath

public Class Color4b

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

A four-byte color value represented by byte x, y, z, and w values. The x, y, z, and w values represent the red, green, blue, and alpha values, respectively.

Note that Java defines a byte as a signed integer in the range [-128, 127]. However, colors are more typically represented by values in the range [0, 255]. Java 3D recognizes this and for color treats the bytes as if the range were [0, 255]---in other words, as if the bytes were unsigned.

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.Tuple4b:
wxyz

Constructor Summary

AccessConstructor and Description
public
Color4b(byte
the red color value
b1
,
byte
the green color value
b2
,
byte
the blue color value
b3
,
byte
the alpha value
b4
)

Constructs and initializes a Color4b from the four specified values.

public
Color4b(byte[]
the array of length 4 containing r, g, b, and alpha in order
c
)

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

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

Constructs and initializes a Color4b from the specified Color4b.

public
Color4b(Tuple4b
the Tuple4b containing the initialization r,g,b,a data
t1
)

Constructs and initializes a Color4b from the specified Tuple4b.

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

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

public
Color4b()

Constructs and initializes a Color4b to (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 Color4b object.

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

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

Inherited from javax.vecmath.Tuple4b:
cloneequalsequalsgetgetgetWgetXgetYgetZhashCodesetsetsetWsetXsetYsetZtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple4b.serialVersionUID.

Constructor Detail

Color4bback to summary
public Color4b(byte b1, byte b2, byte b3, byte b4)

Constructs and initializes a Color4b from the four specified values.

Parameters
b1:byte

the red color value

b2:byte

the green color value

b3:byte

the blue color value

b4:byte

the alpha value

Color4bback to summary
public Color4b(byte[] c)

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

Parameters
c:byte[]

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

Color4bback to summary
public Color4b(Color4b c1)

Constructs and initializes a Color4b from the specified Color4b.

Parameters
c1:Color4b

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

Color4bback to summary
public Color4b(Tuple4b t1)

Constructs and initializes a Color4b from the specified Tuple4b.

Parameters
t1:Tuple4b

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

Color4bback to summary
public Color4b(Color color)

Constructs and initializes a Color4b 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 Color4b object

Since
vecmath 1.2
Color4bback to summary
public Color4b()

Constructs and initializes a Color4b to (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 Color4b 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 Color4b 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 Color4b object

Since
vecmath 1.2