Package com.aowagie.text.html
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 java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final WebColors
HashMap containing all the names and corresponding color values.private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Color
getRGBColor
(String name) Gives you a Color based on a name.Methods inherited from class java.util.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, values
Methods inherited from class java.util.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.
-