| java.lang.Object org.apache.fop.util.ColorUtil
ColorUtil | final public class ColorUtil (Code) | | Generic Color helper class.
This class supports parsing string values into color values and creating
color values for strings. It provides a list of standard color names.
|
Field Summary | |
protected static Log | log |
Method Summary | |
public static String | colorToString(Color color) Creates a re-parsable string representation of the given color.
First, the color will be converted into the sRGB colorspace. | public static Color | parseColorString(FOUserAgent foUserAgent, String value) Creates a color from a given string.
This function supports a wide variety of inputs.
- #RGB (hex 0..f)
- #RGBA (hex 0..f)
- #RRGGBB (hex 00..ff)
- #RRGGBBAA (hex 00..ff)
- rgb(r,g,b) (0..255 or 0%..100%)
- java.awt.Color[r=r,g=g,b=b] (0..255)
- system-color(colorname)
- transparent
- colorname
- fop-rgb-icc
- cmyk
Parameters: foUserAgent - FOUserAgent object Parameters: value - the string to parse. |
log | protected static Log log(Code) | | Logger instance
|
colorToString | public static String colorToString(Color color)(Code) | | Creates a re-parsable string representation of the given color.
First, the color will be converted into the sRGB colorspace. It will then
be printed as #rrggbb, or as #rrrggbbaa if an alpha value is present.
Parameters: color - the color to represent. a re-parsable string representadion. |
parseColorString | public static Color parseColorString(FOUserAgent foUserAgent, String value) throws PropertyException(Code) | | Creates a color from a given string.
This function supports a wide variety of inputs.
- #RGB (hex 0..f)
- #RGBA (hex 0..f)
- #RRGGBB (hex 00..ff)
- #RRGGBBAA (hex 00..ff)
- rgb(r,g,b) (0..255 or 0%..100%)
- java.awt.Color[r=r,g=g,b=b] (0..255)
- system-color(colorname)
- transparent
- colorname
- fop-rgb-icc
- cmyk
Parameters: foUserAgent - FOUserAgent object Parameters: value - the string to parse. a Color representing the string if possible throws: PropertyException - if the string is not parsable or does not follow any of thegiven formats. |
|
|