Package jahuwaldt.j3d

Class JColor4f

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class JColor4f
    extends org.jogamp.vecmath.Color4f
    implements java.io.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:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.jogamp.vecmath.Tuple4f

        w, x, y, z
    • Constructor Summary

      Constructors 
      Constructor Description
      JColor4f()
      Constructs and initializes a Color4f to (0.0, 0.0, 0.0, 0.0).
      JColor4f​(float[] c)
      Constructs and initializes a Color4f from the array of length 4.
      JColor4f​(float x, float y, float z, float w)
      Constructs and initializes a Color4f from the specified xyzw coordinates.
      JColor4f​(JColor4f c1)
      Constructs and initializes a Color4f from the specified Color4f.
      JColor4f​(java.awt.Color color)
      Constructs and initializes a Color4f from the specified AWT Color object.
      JColor4f​(org.jogamp.vecmath.Tuple4d t1)
      Constructs and initializes a Color4f from the specified Tuple4d.
      JColor4f​(org.jogamp.vecmath.Tuple4f t1)
      Constructs and initializes a Color4f from the specified Tuple4f.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Color get()
      Returns a new AWT color object initialized with the r,g,b,a values of this Color4f object.
      void set​(java.awt.Color color)
      Sets the r,g,b,a values of this Color4f object to those of the specified AWT Color object.
      • Methods inherited from class org.jogamp.vecmath.Tuple4f

        absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, getW, getX, getY, getZ, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setW, setX, setY, setZ, sub, sub, toString
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JColor4f

        public JColor4f​(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
      • JColor4f

        public JColor4f​(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
      • JColor4f

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

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

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

        public JColor4f​(java.awt.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
      • JColor4f

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

      • set

        public final void set​(java.awt.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 java.awt.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