javax.vecmath
Class Color3b

java.lang.Object
  extended by javax.vecmath.Tuple3b
      extended by javax.vecmath.Color3b
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Color3b
extends Tuple3b
implements java.io.Serializable

A three-byte color value represented by byte x, y, and z values. The x, y, and z values represent the red, green, and blue 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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.vecmath.Tuple3b
x, y, z
 
Constructor Summary
Color3b()
          Constructs and initializes a Color3b to (0,0,0).
Color3b(byte[] c)
          Constructs and initializes a Color3b from input array of length 3.
Color3b(byte c1, byte c2, byte c3)
          Constructs and initializes a Color3b from the specified three values.
Color3b(java.awt.Color color)
          Constructs and initializes a Color3b from the specified AWT Color object.
Color3b(Color3b c1)
          Constructs and initializes a Color3b from the specified Color3b.
Color3b(Tuple3b t1)
          Constructs and initializes a Color3b from the specified Tuple3b.
 
Method Summary
 java.awt.Color get()
          Returns a new AWT color object initialized with the r,g,b values of this Color3b object.
 void set(java.awt.Color color)
          Sets the r,g,b values of this Color3b object to those of the specified AWT Color object.
 
Methods inherited from class javax.vecmath.Tuple3b
clone, equals, equals, get, get, getX, getY, getZ, hashCode, set, set, setX, setY, setZ, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Color3b

public Color3b(byte c1,
               byte c2,
               byte c3)
Constructs and initializes a Color3b from the specified three values.

Parameters:
c1 - the red color value
c2 - the green color value
c3 - the blue color value

Color3b

public Color3b(byte[] c)
Constructs and initializes a Color3b from input array of length 3.

Parameters:
c - the array of length 3 containing the r,g,b data in order

Color3b

public Color3b(Color3b c1)
Constructs and initializes a Color3b from the specified Color3b.

Parameters:
c1 - the Color3b containing the initialization r,g,b data

Color3b

public Color3b(Tuple3b t1)
Constructs and initializes a Color3b from the specified Tuple3b.

Parameters:
t1 - the Tuple3b containing the initialization r,g,b data

Color3b

public Color3b(java.awt.Color color)
Constructs and initializes a Color3b 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 Color3b object
Since:
vecmath 1.2

Color3b

public Color3b()
Constructs and initializes a Color3b to (0,0,0).

Method Detail

set

public final void set(java.awt.Color color)
Sets the r,g,b values of this Color3b 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 Color3b 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 Color3b object.

Returns:
a new AWT Color object
Since:
vecmath 1.2


Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.