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.Serializable
Implementation of RGBColor.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private CSSValueImpl
alpha_
private CSSValueImpl
blue_
private boolean
commaSeparated_
private java.lang.String
function_
private CSSValueImpl
green_
private CSSValueImpl
red_
-
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 CSSValueImpl
getAlpha()
CSSValueImpl
getBlue()
CSSValueImpl
getGreen()
private static CSSValueImpl
getPart(LexicalUnit next)
CSSValueImpl
getRed()
void
setAlpha(CSSValueImpl alpha)
Sets the alpha part to a new value.void
setBlue(CSSValueImpl blue)
Sets the blue part to a new value.void
setGreen(CSSValueImpl green)
Sets the green part to a new value.void
setRed(CSSValueImpl red)
Sets the red part to a new value.java.lang.String
toString()
-
-
-
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.DOMException
Constructor 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:
toString
in classjava.lang.Object
-
-