org.apache.fop.util
public final class ColorUtil extends java.lang.Object
This class supports parsing string values into color values and creating color values for strings. It provides a list of standard color names.
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
Logger instance
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
colorToString(java.awt.Color color)
Creates a re-parsable string representation of the given color.
|
static java.awt.Color |
parseColorString(FOUserAgent foUserAgent,
java.lang.String value)
Creates a color from a given string.
|
public static java.awt.Color parseColorString(FOUserAgent foUserAgent, java.lang.String value) throws PropertyException
This function supports a wide variety of inputs.
foUserAgent
- FOUserAgent objectvalue
- the string to parse.PropertyException
- if the string is not parsable or does not follow any of the
given formats.public static java.lang.String colorToString(java.awt.Color 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.
color
- the color to represent.Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.