Package com.webfirmframework.wffweb.css
Class HslaCssValue
java.lang.Object
com.webfirmframework.wffweb.data.AbstractBean<HslaCssValue>
com.webfirmframework.wffweb.css.HslaCssValue
- All Implemented Interfaces:
Bean
,Serializable
,Cloneable
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorDescriptionThe default value is hsla(0, 0%, 0%, 1).HslaCssValue
(int h, float s, float l, float a) HslaCssValue
(HslaCssValue hslCssValue) HslaCssValue
(String hslCssValue) -
Method Summary
Methods inherited from class com.webfirmframework.wffweb.data.AbstractBean
getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer
-
Constructor Details
-
HslaCssValue
public HslaCssValue()The default value is hsla(0, 0%, 0%, 1).- Since:
- 1.0.0
-
HslaCssValue
- Parameters:
hslCssValue
- eg:-hsla(155, 55%, 75%, 1)
-
HslaCssValue
-
HslaCssValue
public HslaCssValue(int h, float s, float l, float a) - 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.a
- alpha value. accepts values only from 0 to 1.
-
-
Method Details
-
setHsla
- Parameters:
hsl
- eg:-hsla(155, 55%, 75%, 1)
- 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
- Returns:
- the unit for saturation s.
- Since:
- 1.0.0
-
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
-
setA
public void setA(float a) - Parameters:
a
- the alpha value, it should be in between 0 to 1.- Since:
- 1.0.0
-
getA
public float getA()To get the alpha value.- Returns:
- the a
- Since:
- 1.0.0
-
toString
-
getValue
- Returns:
- the print format of these values as a css value.
- Since:
- 1.0.0
-
isValid
- Parameters:
hslString
- eg:- hsla(125, 55%, 75%, 1)- Returns:
- true if valid and false for invalid.
- Since:
- 1.0.0
-