Class RgbaCssValue

    • Constructor Detail

      • RgbaCssValue

        public RgbaCssValue​()
        The default value is rgba(0, 0, 0, 1)
        Since:
        1.0.0
      • RgbaCssValue

        public RgbaCssValue​(java.lang.String rgbaCssValue)
        Parameters:
        rgbaCssValue - eg:- rgba(15, 55, 155, 1)
      • RgbaCssValue

        public RgbaCssValue​(RgbaCssValue rgbaCssValue)
        Parameters:
        rgbaCssValue -
        Since:
        1.0.0
      • RgbaCssValue

        public RgbaCssValue​(int r,
                            int g,
                            int b,
                            float a)
        Parameters:
        r - red value. accepts values only from 0 to 255.
        g - green value. accepts values only from 0 to 255.
        b - blue value. accepts values only from 0 to 255.
        a - alpha value. accepts values only from 0 to 1.
    • Method Detail

      • setRgba

        public void setRgba​(java.lang.String rgba)
        Parameters:
        rgba - eg:- rgba(15, 55, 155, 0.5)
        Since:
        1.0.0
      • getR

        public int getR​()
        Returns:
        the red value.
        Since:
        1.0.0
      • setR

        public void setR​(int r)
        to set the red value which is in between 0 to 255.
        Parameters:
        b -
        Since:
        1.0.0
      • getG

        public int getG​()
        Returns:
        the green value.
        Since:
        1.0.0
      • setG

        public void setG​(int g)
        to set the green value which is in between 0 to 255.
        Parameters:
        b -
        Since:
        1.0.0
      • getB

        public int getB​()
        Returns:
        the blue value.
        Since:
        1.0.0
      • getA

        public float getA​()
        Returns:
        the alpha value.
        Since:
        1.0.0
      • setB

        public void setB​(int b)
        to set the blue value which is in between 0 to 255.
        Parameters:
        b -
        Since:
        1.0.0
      • setA

        public void setA​(float a)
        to set alpha. The default value is 0.
        Parameters:
        a -
        Since:
        1.0.0
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object
      • getValue

        public java.lang.String getValue​()
        Returns:
        the print format of these values as a css value.
        Since:
        1.0.0
      • isValid

        public static boolean isValid​(java.lang.String rgbaString)
        Parameters:
        rgbString - eg:- rgba(25, 155, 55, 0.2)
        Returns:
        true if valid and false for invalid.
        Since:
        1.0.0