Package com.webfirmframework.wffweb.css
Class Color
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<Color>
com.webfirmframework.wffweb.css.Color
- All Implemented Interfaces:
CssProperty
,StateChangeInformer<Bean>
,Serializable
,Cloneable
color: color|initial|inherit; The color property specifies the color of text. Tip: Use a background color and a text color that makes the text easy to read. Inherited: yes Animatable: yes Version: CSS1 JavaScript syntax: object.style.color="#0000FF"
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionColor()
Theinitial
will be set as the valueColor
(CssColorName cssColorName) Color
(RgbCssValue rgbCssValue) -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
gets the value,getCssValue
method can also be used to get the same value.static boolean
void
sets asinherit
void
sets asinitial
setCssValue
(String cssValue) void
setHslaCssValue
(HslaCssValue hslaCssValue) void
setHslCssValue
(HslCssValue hslCssValue) void
setRgbaCssValue
(RgbaCssValue rgbaCssValue) void
setRgbCssValue
(RgbCssValue rgbCssValue) setValue
(CssColorName cssColorName) the color/color code to set.void
stateChanged
(Bean stateChangedObject) toString()
Methods inherited from class com.webfirmframework.wffweb.css.core.AbstractCssProperty
clone, getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer, toCssString
-
Field Details
-
INITIAL
- See Also:
-
INHERIT
- See Also:
-
-
Constructor Details
-
Color
public Color()Theinitial
will be set as the value -
Color
- Parameters:
cssValue
- the css value to set.
-
Color
- Parameters:
color
- theColor
object from which the cssValue to set.And,null
will throwNullValueException
-
Color
- Parameters:
cssColorName
- theCssColorName
object from which the color name will be taken for cssValue to set. And,null
will throwNullValueException
.- Since:
- 1.1.4
-
Color
- Parameters:
rgbCssValue
-
-
-
Method Details
-
setValue
the color/color code to set. The alternative methodsetCssValue
can also be used.- Parameters:
value
-- Returns:
- the current object
- Since:
- 1.0.0
-
setValue
- Parameters:
cssColorName
- the cssColorName object from which the color name will be taken for setting value.- Returns:
- the current object
- Since:
- 1.1.4
-
getCssName
- Specified by:
getCssName
in interfaceCssProperty
- Returns:
- the name portion in style, eg
align-content
for stylealign-content: center
.
-
getCssValue
- Specified by:
getCssValue
in interfaceCssProperty
- Returns:
- the value portion in style, eg
center
for stylealign-content: center
.
-
toString
-
getValue
gets the value,getCssValue
method can also be used to get the same value.- Returns:
- the value in String.
- Since:
- 1.0.0
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<Color>
- Parameters:
cssValue
- the value should be a color/color code/rgb, for example#0000ff
.null
is considered as an invalid value and it will throwNullValueException
.And an empty string is also considered as an invalid value and it will throwInvalidValueException
.- Returns:
- the current object.
- Since:
- 1.0.0
-
setAsInitial
public void setAsInitial()sets asinitial
- Since:
- 1.0.0
-
setAsInherit
public void setAsInherit()sets asinherit
- Since:
- 1.0.0
-
isValid
- Parameters:
cssValue
-- Returns:
- true if the given
cssValue
is valid. - Since:
- 1.0.0
-
stateChanged
- Specified by:
stateChanged
in interfaceStateChangeInformer<Bean>
-
getRgbCssValue
- Returns:
- the rgbCssValue
- Since:
- 1.0.0
-
getRgbaCssValue
- Returns:
- the rgbaCssValue
- Since:
- 1.0.0
-
getHslCssValue
- Returns:
- the hslCssValue
- Since:
- 1.0.0
-
getHslaCssValue
- Returns:
- the hslaCssValue
- Since:
- 1.0.0
-
setRgbCssValue
- Parameters:
rgbCssValue
- the rgbCssValue to set- Since:
- 1.0.0
-
setRgbaCssValue
- Parameters:
rgbaCssValue
- the rgbaCssValue to set- Since:
- 1.0.0
-
setHslCssValue
- Parameters:
hslCssValue
- the hslCssValue to set- Since:
- 1.0.0
-
setHslaCssValue
- Parameters:
hslaCssValue
- the hslaCssValue to set- Since:
- 1.0.0
-