java.lang.Object
io.sf.carte.doc.style.css.property.StyleValue
io.sf.carte.doc.style.css.property.PrimitiveValue
io.sf.carte.doc.style.css.property.TypedValue
io.sf.carte.doc.style.css.property.ColorValue
io.sf.carte.doc.style.css.property.HWBColorValue
- All Implemented Interfaces:
CSSColorValue,CSSPrimitiveValue,CSSTypedValue,CSSValue,HWBColorValue,Serializable,Cloneable
HWB color value.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSColorValue
CSSColorValue.ColorModelNested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this object.booleangetColor()Get the HWB color represented by this value.Get the color model with which this value was set.getComponent(int index) Get the color component atindex.Get a string representation of the current value.getMinifiedCssText(String propertyValue) Gives a minified version of the css text of the property.inthashCode()voidsetComponent(int index, StyleValue component) If this value has components, set the component atindex.If this value represents a color, get it or transform to a RGB color.Methods inherited from class io.sf.carte.doc.style.css.property.ColorValue
deltaE2000, getComponentCount, isSystemDefault, setCssText, setSystemDefault, toHSLColorValue, toLABColorValue, toLCHColorValue, writeCssTextMethods inherited from class io.sf.carte.doc.style.css.property.TypedValue
getCssValueType, getFloatValue, isNumberZeroMethods inherited from class io.sf.carte.doc.style.css.property.PrimitiveValue
getPrecedingComments, getPrimitiveType, getTrailingComments, isPrimitiveValue, isSubproperty, setExpectInteger, setSubpropertyMethods inherited from class io.sf.carte.doc.style.css.property.StyleValue
matches, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.sf.carte.doc.style.css.CSSColorValue
deltaE2000, toLABColorValue, toLCHColorValue, toRGBColorMethods inherited from interface io.sf.carte.doc.style.css.CSSPrimitiveValue
getUnitType, isNegativeNumber, isPrimitiveValue, setExpectIntegerMethods inherited from interface io.sf.carte.doc.style.css.CSSTypedValue
getFloatValue, getFloatValue, getStringValue, isCalculatedNumber, isNumberZero, setFloatValue, setStringValue, toRGBColorValueMethods inherited from interface io.sf.carte.doc.style.css.CSSValue
getCssValueType, getMinifiedCssText, getPrecedingComments, getPrimitiveType, getTrailingComments, matches, setCssText, writeCssTextMethods inherited from interface io.sf.carte.doc.style.css.HWBColorValue
getHWBColorValue
-
Constructor Details
-
HWBColorValue
public HWBColorValue()
-
-
Method Details
-
getColorModel
Description copied from interface:CSSColorValueGet the color model with which this value was set.- Specified by:
getColorModelin interfaceCSSColorValue- Returns:
- the color model.
-
getCssText
Description copied from class:StyleValueGet a string representation of the current value.- Specified by:
getCssTextin interfaceCSSValue- Overrides:
getCssTextin classColorValue- Returns:
- the css text representing the value of this property.
-
getMinifiedCssText
Description copied from interface:CSSValueGives a minified version of the css text of the property.It may be customized for the given property name.
- Specified by:
getMinifiedCssTextin interfaceCSSValue- Overrides:
getMinifiedCssTextin classColorValue- Parameters:
propertyValue- the property name.- Returns:
- the minified css text.
-
getComponent
Description copied from class:ColorValueGet the color component atindex.This method allows to access the color components like if they were indexed. It is convenient to perform common tasks at the components (like when computing values).
- Specified by:
getComponentin classColorValue- Parameters:
index- the index. Index0is always the alpha channel.- Returns:
- the color component, or
nullif the index is incorrect.
-
setComponent
Description copied from class:TypedValueIf this value has components, set the component atindex.This method allows to access the components regardless of them being formally indexed or not. It is convenient to perform common tasks at the components (like when computing values).
- Overrides:
setComponentin classColorValue- Parameters:
index- the index. For colors, index0is always the alpha channel. Setting a component at an index that does not exist has no effect.component- the new component. Cannot be aKEYWORDnor aSHORTHAND. For colors, must be a primitive value (that is, eitherTYPEDor aPROXY).
-
toRGBColor
Description copied from interface:CSSTypedValueIf this value represents a color, get it or transform to a RGB color.If the color does not map into the sRGB gamut, it is clamped.
- Specified by:
toRGBColorin interfaceCSSTypedValue- Returns:
- the RGBA color.
- Throws:
DOMException- INVALID_ACCESS_ERR: if this value can't return a RGB color value (either is not aCOLORor not a typed value).
NOT_SUPPORTED_ERR: if the conversion needs device color space information to be performed accurately.
-
getColor
Description copied from interface:HWBColorValueGet the HWB color represented by this value.- Specified by:
getColorin interfaceCSSColorValue- Specified by:
getColorin interfaceHWBColorValue- Returns:
- the HWB color.
-
hashCode
public int hashCode()- Overrides:
hashCodein classPrimitiveValue
-
equals
- Overrides:
equalsin classPrimitiveValue
-
clone
Description copied from class:TypedValueCreates and returns a copy of this object.The object will be the same except for the
subpropertyflag, that will be disabled in the clone object.- Specified by:
clonein interfaceCSSColorValue- Specified by:
clonein interfaceCSSTypedValue- Specified by:
clonein interfaceCSSValue- Specified by:
clonein interfaceHWBColorValue- Specified by:
clonein classColorValue- Returns:
- a copy of this object.
-