Package org.htmlunit.css
Class CssColors
java.lang.Object
org.htmlunit.css.CssColors
Helper to work with colors.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isColorKeyword
(String token) Returns if the specified token is a reserved color keyword.static String
toRGBColor
(String color) Gets the RGB equivalent of a CSS color if the provided color is recognized.
-
Field Details
-
CSSColors_
-
-
Constructor Details
-
CssColors
private CssColors()
-
-
Method Details
-
isColorKeyword
Returns if the specified token is a reserved color keyword.- Parameters:
token
- the token to check- Returns:
- whether the token is a reserved color keyword or not
-
toRGBColor
Gets the RGB equivalent of a CSS color if the provided color is recognized.- Parameters:
color
- the color- Returns:
- the provided color if this is not a recognized color keyword, the RGB value in the form "rgb(x, y, z)" otherwise
-