Class HslCssValue

    • Constructor Detail

      • HslCssValue

        public HslCssValue​()
      • HslCssValue

        public HslCssValue​(java.lang.String hslCssValue)
        Parameters:
        hslCssValue - eg:- hsl(155, 55%, 75%)
      • HslCssValue

        public HslCssValue​(HslCssValue hslCssValue)
      • HslCssValue

        public HslCssValue​(int h,
                           float s,
                           float l)
        Parameters:
        h - hue value. accepts values only from 0 to 360.
        s - saturation value. accepts values only from 0 to 100.
        l - lightness value. accepts values only from 0 to 100.
    • Method Detail

      • setHsl

        public void setHsl​(java.lang.String hsl)
        Parameters:
        hsl - eg:- hsl(155, 55%, 75%)
        Since:
        1.0.0
      • getH

        public int getH​()
      • setH

        public void setH​(int h)
        Parameters:
        h - the hue value, it should be in between 0 to 360.
        Since:
        1.0.0
      • getS

        public float getS​()
        Returns:
        the saturation value. Its unit is always %.
        Since:
        1.0.0
      • setS

        public void setS​(float s)
        Parameters:
        s - the saturation value, it should be in between 0 to 100.
        Since:
        1.0.0
      • getL

        public float getL​()
        Returns:
        the lightness value. Its unit is always %.
        Since:
        1.0.0
      • getSUnit

        public static CssLengthUnit getSUnit​()
        Returns:
        the unit for saturation s.
        Since:
        1.0.0
      • getLUnit

        public static CssLengthUnit getLUnit​()
        Returns:
        the unit for lightness l.
        Since:
        1.0.0
      • setL

        public void setL​(float l)
        Parameters:
        l - the lightness value, it should be in between 0 to 100.
        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 hslString)
        Parameters:
        hslString - eg:- hsl(125, 55%, 75%)
        Returns:
        true if valid and false for invalid.
        Since:
        1.0.0