Package org.mapfish.print.map.style.json
Class ColorParser
java.lang.Object
org.mapfish.print.map.style.json.ColorParser
Parses colors from text strings. Supports formats:
#F00#FFAABBrgb(100,100,100)rgba(100,100,100, 100)hsl(100,100,100)hsla(100,100,100, 100)-65536red
- 0-255
- 0%-100%
- 0.0%-100.0%
- 0.0-1.0
- 0f-1f
- 0.0f-1.0f
-
Method Summary
-
Method Details
-
toColor
Parse the string and convert it to aColor. See class description for details on the supported color formats.- Parameters:
colorString- the color string encoded.- Returns:
- Always return a Color or an exception
- Throws:
NumberFormatException- when the colorString cannot be parsed
-
canParseColor
Check if the given color string can be parsed.- Parameters:
colorString- The color to parse.
-
toRGB
Get the "rgb(...)" representation for a color.- Parameters:
color- The color.
-