Class ColorRGBA

  • All Implemented Interfaces:
    java.io.Serializable

    public class ColorRGBA
    extends java.lang.Object
    implements java.io.Serializable
    ColorRGBA. Red, Green, Blue, Alpha. The components are intended to be in the interval [0,1]
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float A
      Alpha component [0,1]
      float B
      Blue component [0,1]
      static ColorRGBA BLACK
      Constant ColorRGBA: Black (0,0,0,1)
      float G
      Green component [0,1]
      static ColorRGBA INVALID
      Constant ColorRGBA: Invalid color (-1,-1,-1,-1)
      float R
      Red component [0,1]
      private static long serialVersionUID  
      static ColorRGBA WHITE
      Constant ColorRGBA: White (1,1,1,1)
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorRGBA()
      Construction.
      ColorRGBA​(float fR, float fG, float fB, float fA)
      Construction.
      ColorRGBA​(ColorRGBA rkC)
      Construction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void Clamp()
      Transform the color channels to [0,1].
      void Copy​(ColorRGBA rkC)
      Copy.
      boolean equals​(java.lang.Object kObject)  
      int hashCode()  
      void ScaleByMax()
      Transform the color channels to [0,1].
      void Set​(float fR, float fG, float fB, float fA)
      Sets the R,G,B values of this ColorRGB The components are intended to be in the interval [0,1].
      java.lang.String toString()
      Returns a string representation of the vector values.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • BLACK

        public static final ColorRGBA BLACK
        Constant ColorRGBA: Black (0,0,0,1)
      • WHITE

        public static final ColorRGBA WHITE
        Constant ColorRGBA: White (1,1,1,1)
      • INVALID

        public static final ColorRGBA INVALID
        Constant ColorRGBA: Invalid color (-1,-1,-1,-1)
      • R

        public float R
        Red component [0,1]
      • G

        public float G
        Green component [0,1]
      • B

        public float B
        Blue component [0,1]
      • A

        public float A
        Alpha component [0,1]
    • Constructor Detail

      • ColorRGBA

        public ColorRGBA()
        Construction. The components are intended to be in the interval [0,1]. Default construction initial values (0,0,0,1)
      • ColorRGBA

        public ColorRGBA​(ColorRGBA rkC)
        Construction. The components are intended to be in the interval [0,1].
        Parameters:
        rkC - value from rkC are copied into this.
      • ColorRGBA

        public ColorRGBA​(float fR,
                         float fG,
                         float fB,
                         float fA)
        Construction. The components are intended to be in the interval [0,1].
        Parameters:
        fR - red value
        fG - green value
        fB - blue value
        fA - alpha value
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of the vector values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representation of the vector values.
      • Clamp

        public void Clamp()
        Transform the color channels to [0,1]. Clamp sets negative values to zero and values larger than one to one. ScaleByMax assumes the color channels are nonnegative, finds the maximum color channel, and divides all channels by that value.
      • Copy

        public void Copy​(ColorRGBA rkC)
        Copy. The components are intended to be in the interval [0,1].
        Parameters:
        rkC - value from rkC are copied into this.
      • equals

        public boolean equals​(java.lang.Object kObject)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • ScaleByMax

        public void ScaleByMax()
        Transform the color channels to [0,1]. Clamp sets negative values to zero and values larger than one to one. ScaleByMax assumes the color channels are nonnegative, finds the maximum color channel, and divides all channels by that value.
      • Set

        public void Set​(float fR,
                        float fG,
                        float fB,
                        float fA)
        Sets the R,G,B values of this ColorRGB The components are intended to be in the interval [0,1].
        Parameters:
        fR - red value
        fG - green value
        fB - blue value
        fA - alpha value