Package com.lowagie.text.html
Class WebColors
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap
com.lowagie.text.html.WebColors
- All Implemented Interfaces:
Serializable,Cloneable,Map
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorgetRGBColor(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, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
NAMES
HashMap containing all the names and corresponding color values.
-
-
Constructor Details
-
WebColors
public WebColors()
-
-
Method Details
-
getRGBColor
Gives you a Color based on a name.- Parameters:
name- the css color name to convert. You can use CSS4 color values- a name such as black, violet, cornflowerblue
- #RGB, #RRGGBB, #RGBA or #RRGGBBAA
- rgb(R, G, B) rgb(R,G,B,A) or rgba(R,G,B) or rgba(R,G,B,A)
- hsl(H, S, L) hsl(H,S,L,A) or hslq(H,S,L) or hsla(H,S,L,A)
- Returns:
- the corresponding Color object
- Throws:
IllegalArgumentException- if the String isn't a know representation of a color.
-