Package com.aowagie.text.html
Class WebColors
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap
-
- com.aowagie.text.html.WebColors
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map
class WebColors extends java.util.HashMap
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 )
-
-
Field Summary
Fields Modifier and Type Field Description private static WebColors
NAMES
HashMap containing all the names and corresponding color values.private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description WebColors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.awt.Color
getRGBColor(java.lang.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, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
NAMES
private static final WebColors NAMES
HashMap containing all the names and corresponding color values.
-
-
Method Detail
-
getRGBColor
static java.awt.Color getRGBColor(java.lang.String name) throws java.lang.IllegalArgumentException
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:
java.lang.IllegalArgumentException
- if the String isn't a know representation of a color.
-
-