public enum ExcelColor extends java.lang.Enum<ExcelColor>
Colors
represent the built-in color names that correspond
with Excel's indexed color scheme. These are used in conjunction with
several property names defined for the style tag. These color names do NOT
necessarily correspond with HTML/CSS standard color names. Legal values are
the names of the enumeration objects, without underscores, case insensitive,
e.g. "center" == "Center" == "CENTER".
StyleTag
,
StyleParser.PROPERTY_BORDER_COLOR
,
StyleParser.PROPERTY_BOTTOM_BORDER_COLOR
,
StyleParser.PROPERTY_LEFT_BORDER_COLOR
,
StyleParser.PROPERTY_RIGHT_BORDER_COLOR
,
StyleParser.PROPERTY_TOP_BORDER_COLOR
,
StyleParser.PROPERTY_FILL_BACKGROUND_COLOR
,
StyleParser.PROPERTY_FILL_FOREGROUND_COLOR
,
StyleParser.PROPERTY_FONT_COLOR
Modifier and Type | Field | Description |
---|---|---|
static org.apache.poi.hssf.util.HSSFColor |
HSSF_COLOR_AUTOMATIC |
The "automatic" color in HSSF (.xls).
|
static short |
XSSF_COLOR_COMMENT |
The color index used by comments in XSSF (.xlsx).
|
Modifier and Type | Method | Description |
---|---|---|
int |
distance(int red,
int green,
int blue) |
Returns the "distance" of the given RGB triplet from this color, as
defined by the sum of each of the differences for the red, green, and
blue values.
|
int |
getBlue() |
Returns the blue value, 0-255.
|
int |
getGreen() |
Returns the green value, 0-255.
|
java.lang.String |
getHexString() |
Returns the hex string, in the format "#RRGGBB".
|
org.apache.poi.hssf.util.HSSFColor |
getHssfColor() |
Return the
HSSFColor . |
static org.apache.poi.hssf.util.HSSFColor |
getHssfColorByIndex(short index) |
Maps a short index color back to an
HSSFColor . |
int |
getIndex() |
Returns the index.
|
org.apache.poi.ss.usermodel.IndexedColors |
getIndexedColor() |
Returns the
IndexedColors . |
int |
getRed() |
Returns the red value, 0-255.
|
org.apache.poi.xssf.usermodel.XSSFColor |
getXssfColor() |
Return the
XSSFColor . |
java.lang.String |
toString() |
Returns the color name, in all lowercase, no underscores or spaces.
|
static ExcelColor |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static ExcelColor[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ExcelColor AQUA
public static final ExcelColor AUTOMATIC
public static final ExcelColor BLACK
public static final ExcelColor BLUE
public static final ExcelColor BLUEGREY
public static final ExcelColor BRIGHTGREEN
public static final ExcelColor BROWN
public static final ExcelColor CORAL
public static final ExcelColor CORNFLOWERBLUE
public static final ExcelColor DARKBLUE
public static final ExcelColor DARKGREEN
public static final ExcelColor DARKRED
public static final ExcelColor DARKTEAL
public static final ExcelColor DARKYELLOW
public static final ExcelColor GOLD
public static final ExcelColor GREEN
public static final ExcelColor GREY25PERCENT
public static final ExcelColor GREY40PERCENT
public static final ExcelColor GREY50PERCENT
public static final ExcelColor GREY80PERCENT
public static final ExcelColor INDIGO
public static final ExcelColor LAVENDER
public static final ExcelColor LEMONCHIFFON
public static final ExcelColor LIGHTBLUE
public static final ExcelColor LIGHTCORNFLOWERBLUE
public static final ExcelColor LIGHTGREEN
public static final ExcelColor LIGHTORANGE
public static final ExcelColor LIGHTTURQUOISE
public static final ExcelColor LIGHTYELLOW
public static final ExcelColor LIME
public static final ExcelColor MAROON
public static final ExcelColor OLIVEGREEN
public static final ExcelColor ORANGE
public static final ExcelColor ORCHID
public static final ExcelColor PALEBLUE
public static final ExcelColor PINK
public static final ExcelColor PLUM
public static final ExcelColor RED
public static final ExcelColor ROSE
public static final ExcelColor ROYALBLUE
public static final ExcelColor SEAGREEN
public static final ExcelColor SKYBLUE
public static final ExcelColor TAN
public static final ExcelColor TEAL
public static final ExcelColor TURQUOISE
public static final ExcelColor VIOLET
public static final ExcelColor WHITE
public static final ExcelColor YELLOW
public static final org.apache.poi.hssf.util.HSSFColor HSSF_COLOR_AUTOMATIC
public static final short XSSF_COLOR_COMMENT
public static ExcelColor[] values()
for (ExcelColor c : ExcelColor.values()) System.out.println(c);
public static ExcelColor valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic org.apache.poi.hssf.util.HSSFColor getHssfColor()
HSSFColor
.HSSFColor
.public org.apache.poi.xssf.usermodel.XSSFColor getXssfColor()
XSSFColor
.XSSFColor
.public int getIndex()
public org.apache.poi.ss.usermodel.IndexedColors getIndexedColor()
IndexedColors
.IndexedColors
.public int getRed()
public int getGreen()
public int getBlue()
public java.lang.String getHexString()
public int distance(int red, int green, int blue)
red
- The red value.green
- The green value.blue
- The blue value.public java.lang.String toString()
toString
in class java.lang.Enum<ExcelColor>
public static org.apache.poi.hssf.util.HSSFColor getHssfColorByIndex(short index)
HSSFColor
.index
- A short color index.HSSFColor
.Copyright © 2012–2018 Jett Team. All rights reserved.