public class Color extends Object implements OOXMLElement
| Modifier and Type | Field and Description |
|---|---|
static int |
COLORTYPEINDEXED |
static int |
COLORTYPERGB |
static int |
COLORTYPETHEME |
| Constructor and Description |
|---|
Color() |
Color(Color c) |
Color(Color c,
String element,
Theme t)
creates a new Color object based upon a java.awt.Color
|
Color(String element,
boolean auto,
int colortype,
String colorval,
double tint,
short type,
Theme t) |
Color(String clr,
String element,
Theme t)
creates a new Color object based upon a web-compliant Hex Color string
|
| Modifier and Type | Method and Description |
|---|---|
OOXMLElement |
cloneElement() |
Color |
getColorAsColor() |
String |
getColorAsOOXMLRBG()
return the translated HTML color string for this OOXML color
|
int |
getColorInt()
return the translated color int for this OOXML color
|
int |
getColorType()
return the color type for this OOXML color
(indexed= 0, rgb= 1, theme= 2)
|
String |
getOOXML() |
static String |
getOOXML(String element,
int colortype,
int colorval,
String colorstr,
double tint) |
static String |
parseColor(String val,
int colortype,
short type,
Theme t)
static version of parseColor --takes a color value of OOXML type type
COLORTYPERBG, COLORTYPEINDEXED or COLORTYPETHEME and returns the |
static int |
parseColorInt(String val,
int colortype,
short type,
Theme t)
static version of parseColor --takes a color value of OOXML type type
COLORTYPERBG, COLORTYPEINDEXED or COLORTYPETHEME and returns the indexed color int it represents |
static OOXMLElement |
parseOOXML(org.xmlpull.v1.XmlPullParser xpp,
short type,
WorkBookHandle bk)
parses a color element
root= color, fgColor or bgColor
|
static Object[] |
parseThemeColor(String colorval,
double tint,
short type,
Theme t)
interprets theme colorval and tint
TODO: read in theme colors from theme1.xml
|
void |
setColor(Color c)
sets the color via java.awt.Color
|
void |
setColor(String clr)
sets the color via a web-compliant Hex Color String
|
void |
setColorInt(int clr)
manually set color int
automatically defaults to indexed color, and looks up color in COLORTABLE
|
String |
toString() |
public static int COLORTYPEINDEXED
public static int COLORTYPERGB
public static int COLORTYPETHEME
public Color()
public Color(String element, boolean auto, int colortype, String colorval, double tint, short type, Theme t)
public Color(Color c)
public Color(Color c, String element, Theme t)
clr - Color objeectelement - "color", "fgColor" or "bgColor"public static OOXMLElement parseOOXML(org.xmlpull.v1.XmlPullParser xpp, short type, WorkBookHandle bk)
xpp - public String getOOXML()
getOOXML in interface OOXMLElementOOXMLElement.getOOXML()public static String getOOXML(String element, int colortype, int colorval, String colorstr, double tint)
public OOXMLElement cloneElement()
cloneElement in interface OOXMLElementOOXMLElement.cloneElement()public int getColorInt()
public int getColorType()
public String getColorAsOOXMLRBG()
public Color getColorAsColor()
public void setColorInt(int clr)
clr - public void setColor(Color c)
c - public void setColor(String clr)
clr - public static String parseColor(String val, int colortype, short type, Theme t)
val - String OOXML color value, value depends upon colortypecolortype - int val's colortype, one of: Color.COLORTYPERGB, Color.COLORTYPEINDEXED, Color.COLORTYPETHEMEtype - 0= font, 1= fillpublic static int parseColorInt(String val, int colortype, short type, Theme t)
val - String OOXML color value, value depends upon colortypecolortype - int val's colortype, one of: Color.COLORTYPERGB, Color.COLORTYPEINDEXED, Color.COLORTYPETHEMEtype - 0= font, 1= fillpublic static Object[] parseThemeColor(String colorval, double tint, short type, Theme t)
colorval - String theme colorval (see SchemeClr and Theme for details)
EITHER an Index into the tint - double tint to apply to the base color (0 for none)type - short 0= font, 1= fillCopyright © 2002–2019 Starter Inc.. All rights reserved.