Class WebColors
java.lang.Object
java.util.AbstractMap
java.util.HashMap
com.aowagie.text.html.WebColors
- All Implemented Interfaces:
Serializable, Cloneable, Map
This class is a HashMap that contains the names of colors as a key and the
corresponding Color as value. (Source: Wikipedia
http://en.wikipedia.org/wiki/Web_colors )
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final WebColorsHashMap containing all the names and corresponding color values.private static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static ColorgetRGBColor(String name) Gives you a Color based on a name.Methods inherited from class HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class AbstractMap
equals, hashCode, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
NAMES
HashMap containing all the names and corresponding color values.
-
-
Constructor Details
-
WebColors
WebColors()
-
-
Method Details
-
getRGBColor
Gives you a Color based on a name.- Parameters:
name- a name such as black, violet, cornflowerblue or #RGB or #RRGGBB or rgb(R,G,B)- Returns:
- the corresponding Color object
- Throws:
IllegalArgumentException- if the String isn't a know representation of a color.
-