Class Color


  • public class Color
    extends java.lang.Object
    An RGBA color. Each component is a value with a range from 0 to 1. Can be created from an Android ColorInt.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float a  
      float b  
      float g  
      float r  
    • Constructor Summary

      Constructors 
      Constructor Description
      Color()
      Construct a Color and default it to white (1, 1, 1, 1).
      Color​(float r, float g, float b)
      Construct a color with the RGB values passed in and an alpha of 1.
      Color​(float r, float g, float b, float a)
      Construct a color with the RGBA values passed in.
      Color​(int argb)
      Construct a color with an integer in the sRGB color space packed as an ARGB value.
      Color​(Color color)
      Construct a Color with the values of another color.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Color inverseTonemap()
      Returns a new color with Sceneform's tonemapping inversed.
      void set​(float r, float g, float b)
      Set to the RGB values passed in and an alpha of 1.
      void set​(float r, float g, float b, float a)
      Set to the RGBA values passed in.
      void set​(int argb)
      Set to RGBA values from an integer in the sRGB color space packed as an ARGB value.
      void set​(Color color)
      Set to the values of another color.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • r

        public float r
      • g

        public float g
      • b

        public float b
      • a

        public float a
    • Constructor Detail

      • Color

        public Color()
        Construct a Color and default it to white (1, 1, 1, 1).
      • Color

        public Color​(Color color)
        Construct a Color with the values of another color.
      • Color

        public Color​(float r,
                     float g,
                     float b)
        Construct a color with the RGB values passed in and an alpha of 1.
      • Color

        public Color​(float r,
                     float g,
                     float b,
                     float a)
        Construct a color with the RGBA values passed in.
      • Color

        public Color​(int argb)
        Construct a color with an integer in the sRGB color space packed as an ARGB value. Used for constructing from an Android ColorInt.
    • Method Detail

      • set

        public void set​(Color color)
        Set to the values of another color.
      • set

        public void set​(float r,
                        float g,
                        float b)
        Set to the RGB values passed in and an alpha of 1.
      • set

        public void set​(float r,
                        float g,
                        float b,
                        float a)
        Set to the RGBA values passed in.
      • set

        public void set​(int argb)
        Set to RGBA values from an integer in the sRGB color space packed as an ARGB value. Used for setting from an Android ColorInt.
      • inverseTonemap

        public Color inverseTonemap()
        Returns a new color with Sceneform's tonemapping inversed.