public class Color extends Object implements OdfDataType
Modifier and Type | Field and Description |
---|---|
static Color |
AQUA
The color aqua in sRGB space.
|
static Color |
BLACK
The color black in sRGB space.
|
static Color |
BLUE
The color blue in sRGB space.
|
static Color |
FUCHSIA
The color fuchsia in sRGB space.
|
static Color |
GRAY
The color gray in sRGB space.
|
static Color |
GREEN
The color green in sRGB space.
|
static Color |
LIME
The color lime in sRGB space.
|
static Color |
MAROON
The color maroon in sRGB space.
|
static Color |
NAVY
The color navy in sRGB space.
|
static Color |
OLIVE
The color olive in sRGB space.
|
static Color |
ORANGE
The color orange in sRGB space.
|
static Color |
PURPLE
The color purple in sRGB space.
|
static Color |
RED
The color red in sRGB space.
|
static Color |
SILVER
The color silver in sRGB space.
|
static Color |
TEAL
The color teal in sRGB space.
|
static Color |
WHITE
The color white in sRGB space.
|
static Color |
YELLOW
The color yellow in sRGB space.
|
Constructor and Description |
---|
Color(Color color)
Construct Color using
. |
Color(float red,
float green,
float blue)
Construct Color using the specified red, green, and blue values in the range (0.0 - 1.0).
|
Color(int red,
int green,
int blue)
Construct Color using the specified red, green and blue values in the range (0 - 255).
|
Color(String color)
Construct Color by the parsing the given string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Color |
getAWTColor()
Return the corresponding
instance of the Color data type. |
int |
hashCode() |
static boolean |
isValid(String colorValue)
Check if the specified String is a valid color data type.
|
static Color |
mapColorToAWTColor(Color color)
Map a Color data type to
. |
static String |
toSixDigitHexRGB(String colorValue)
Convert RGB color formats to six-digit hex RGB format.
|
String |
toString()
Returns the Color in six HEX sRGB notation.
|
static Color |
valueOf(String colorValue)
Returns a Color instance representing the specified String value.
|
public static final Color AQUA
public static final Color BLACK
public static final Color BLUE
public static final Color FUCHSIA
public static final Color GRAY
public static final Color GREEN
public static final Color LIME
public static final Color MAROON
public static final Color NAVY
public static final Color OLIVE
public static final Color ORANGE
public static final Color PURPLE
public static final Color RED
public static final Color SILVER
public static final Color TEAL
public static final Color WHITE
public static final Color YELLOW
public Color(String color)
For further information on sRGB, see http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html .
color
- represented using the 3 or 6 HEX sRGB notation.IllegalArgumentException
- if the given argument is not a valid Color in sRGB HEX notation.public Color(int red, int green, int blue)
red
- the red component.green
- the green component.blue
- the blue component.IllegalArgumentException
- if red
, green
or blue
are outside of the range 0 to 255, inclusive.public Color(float red, float green, float blue)
red
- the red componentgreen
- the green componentblue
- the blue componentIllegalArgumentException
- if red
, green
or blue
are
outside of the range 0.0 to 1.0, inclusive.public Color(Color color)
java.awt.Color
.color
- the specified java.awt.Color
.IllegalArgumentException
- if the given argument is not a valid Color.Color
public String toString()
public static Color valueOf(String colorValue)
colorValue
- a six (or three) number hexadecimal string representation of the ColorstringValue
.IllegalArgumentException
- if the given argument is not a valid Color.public static boolean isValid(String colorValue)
colorValue
- a six (or three) number hexadecimal string representation of the Colorpublic static String toSixDigitHexRGB(String colorValue)
colorValue
- The sRGB color value to be converted.public Color getAWTColor()
java.awt.Color
instance of the Color data type.java.awt.Color
instance..public static Color mapColorToAWTColor(Color color)
java.awt.Color
.color
- The color data type to be mapped..java.awt.Color
instance.Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.