Package org.htmlunit.cssparser.dom
Class RGBColorImpl
- java.lang.Object
-
- org.htmlunit.cssparser.dom.RGBColorImpl
-
- All Implemented Interfaces:
java.io.Serializable
public class RGBColorImpl extends java.lang.Object implements java.io.SerializableImplementation of RGBColor.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private CSSValueImplalpha_private CSSValueImplblue_private booleancommaSeparated_private java.lang.Stringfunction_private CSSValueImplgreen_private CSSValueImplred_
-
Constructor Summary
Constructors Constructor Description RGBColorImpl(java.lang.String function, LexicalUnit lu)Constructor that reads the values from the given chain of LexicalUnits.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CSSValueImplgetAlpha()CSSValueImplgetBlue()CSSValueImplgetGreen()private static CSSValueImplgetPart(LexicalUnit next)CSSValueImplgetRed()voidsetAlpha(CSSValueImpl alpha)Sets the alpha part to a new value.voidsetBlue(CSSValueImpl blue)Sets the blue part to a new value.voidsetGreen(CSSValueImpl green)Sets the green part to a new value.voidsetRed(CSSValueImpl red)Sets the red part to a new value.java.lang.StringtoString()
-
-
-
Field Detail
-
function_
private final java.lang.String function_
-
red_
private CSSValueImpl red_
-
green_
private CSSValueImpl green_
-
blue_
private CSSValueImpl blue_
-
alpha_
private CSSValueImpl alpha_
-
commaSeparated_
private final boolean commaSeparated_
-
-
Constructor Detail
-
RGBColorImpl
public RGBColorImpl(java.lang.String function, LexicalUnit lu) throws org.w3c.dom.DOMExceptionConstructor that reads the values from the given chain of LexicalUnits.- Parameters:
function- the name of the function; rgb or rgbalu- the values- Throws:
org.w3c.dom.DOMException- in case of error
-
-
Method Detail
-
getPart
private static CSSValueImpl getPart(LexicalUnit next)
-
getRed
public CSSValueImpl getRed()
- Returns:
- the red part.
-
setRed
public void setRed(CSSValueImpl red)
Sets the red part to a new value.- Parameters:
red- the new CSSPrimitiveValue
-
getGreen
public CSSValueImpl getGreen()
- Returns:
- the green part.
-
setGreen
public void setGreen(CSSValueImpl green)
Sets the green part to a new value.- Parameters:
green- the new CSSPrimitiveValue
-
getBlue
public CSSValueImpl getBlue()
- Returns:
- the blue part.
-
setBlue
public void setBlue(CSSValueImpl blue)
Sets the blue part to a new value.- Parameters:
blue- the new CSSPrimitiveValue
-
getAlpha
public CSSValueImpl getAlpha()
- Returns:
- the alpha part.
-
setAlpha
public void setAlpha(CSSValueImpl alpha)
Sets the alpha part to a new value.- Parameters:
alpha- the new CSSPrimitiveValue
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-