java.lang.Object
io.sf.carte.doc.style.css.property.ColorIdentifiers
CSS Color identifiers map.
Per CSS3 color spec, section 4.3.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the color associated to the given keyword.static ColorIdentifiers
Gets the instance of this class.boolean
isColorIdentifier
(String identifier) Is this a known color identifier ?boolean
isSystemColor
(String identifier) Is this a system color identifier ?
-
Constructor Details
-
ColorIdentifiers
public ColorIdentifiers()
-
-
Method Details
-
getInstance
Gets the instance of this class.- Returns:
- the singleton instance of this class.
-
getColor
Gets the color associated to the given keyword.- Parameters:
keyword
- the color keyword (orange, blue, etc.). Must be lowercase.- Returns:
- the corresponding #-starting hex color specification, or null if the keyword could not be recognized as a color.
-
isSystemColor
Is this a system color identifier ?- Parameters:
identifier
- the lowercase identifier to be tested.- Returns:
true
if it is a system color identifier.
-
isColorIdentifier
Is this a known color identifier ?This method tests the identifier against the known predefined color identifiers, including
transparent
,currentcolor
and system colors.- Parameters:
identifier
- the lowercase identifier to be tested.- Returns:
true
if it is a known color identifier.
-