Class HslCssValue

java.lang.Object
com.webfirmframework.wffweb.data.AbstractBean<HslCssValue>
com.webfirmframework.wffweb.css.HslCssValue
All Implemented Interfaces:
Bean, Serializable, Cloneable

public class HslCssValue extends AbstractBean<HslCssValue>
Since:
1.0.0
See Also:
  • Constructor Details

    • HslCssValue

      public HslCssValue()
    • HslCssValue

      public HslCssValue(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 Details

    • setHsl

      public void setHsl(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 String toString()
      Overrides:
      toString in class Object
    • getValue

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

      public static boolean isValid(String hslString)
      Parameters:
      hslString - eg:- hsl(125, 55%, 75%)
      Returns:
      true if valid and false for invalid.
      Since:
      1.0.0