Package javax.vecmath

Class Color4f

All Implemented Interfaces:
Serializable, Cloneable

public class Color4f extends Tuple4f implements Serializable
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.

See Also:
  • Constructor Details

    • Color4f

      public Color4f(float x, float y, float z, float w)
      Constructs and initializes a Color4f from the specified xyzw coordinates.
      Parameters:
      x - the red color value
      y - the green color value
      z - the blue color value
      w - the alpha value
    • Color4f

      public Color4f(float[] c)
      Constructs and initializes a Color4f from the array of length 4.
      Parameters:
      c - the array of length 4 containing r,g,b,a in order
    • Color4f

      public Color4f(Color4f c1)
      Constructs and initializes a Color4f from the specified Color4f.
      Parameters:
      c1 - the Color4f containing the initialization r,g,b,a data
    • Color4f

      public Color4f(Tuple4f t1)
      Constructs and initializes a Color4f from the specified Tuple4f.
      Parameters:
      t1 - the Tuple4f containing the initialization r,g,b,a data
    • Color4f

      public Color4f(Tuple4d t1)
      Constructs and initializes a Color4f from the specified Tuple4d.
      Parameters:
      t1 - the Tuple4d containing the initialization r,g,b,a data
    • Color4f

      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 - the AWT color with which to initialize this Color4f object
      Since:
      vecmath 1.2
    • Color4f

      public Color4f()
      Constructs and initializes a Color4f to (0.0, 0.0, 0.0, 0.0).
  • Method Details

    • set

      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 - the AWT color to copy into this Color4f object
      Since:
      vecmath 1.2
    • get

      public final Color get()
      Returns a new AWT color object initialized with the r,g,b,a values of this Color4f object.
      Returns:
      a new AWT Color object
      Since:
      vecmath 1.2