Package org.openpdf.text.html
Class WebColors
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,int[]>
Deprecated.
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 )
CSS4 Implementation based on: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
- 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
FieldsModifier and TypeFieldDescriptionstatic final WebColorsDeprecated.HashMap containing all the names and corresponding color values.private static final longDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intgetFromPercent(String v, int max) Deprecated.static ColorgetRGBColor(String name) Deprecated.Gives you a Color based on a name.private static ColorgetRGBFromHex(String colorName) Deprecated.private static ColorgetRGBFromHSL(String colorName) Deprecated.private static ColorgetRGBFromName(String colorName) Deprecated.private static ColorgetRGBFromRGB(String colorName) Deprecated.private static int[]hsl2rgb(float hue, float saturation, float lightness) Deprecated.Convert from hsl to rgbprivate static floathue2rgb(float p, float q, float t) Deprecated.private static doubleDeprecated.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
Deprecated.HashMap containing all the names and corresponding color values. -
serialVersionUID
private static final long serialVersionUIDDeprecated.- See Also:
-
-
Constructor Details
-
WebColors
public WebColors()Deprecated.
-
-
Method Details
-
getRGBColor
Deprecated.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.
-
getRGBFromHex
Deprecated. -
getRGBFromRGB
Deprecated. -
getFromPercent
Deprecated. -
getRGBFromName
Deprecated. -
getRGBFromHSL
Deprecated. -
toDegrees
Deprecated. -
hsl2rgb
private static int[] hsl2rgb(float hue, float saturation, float lightness) Deprecated.Convert from hsl to rgb- Parameters:
hue- Hue angle in degreessaturation- saturation (0 to 1)lightness- lightness (0 to 1)- Returns:
- int[] rgb
-
hue2rgb
private static float hue2rgb(float p, float q, float t) Deprecated.
-