net.sf.jett.model
Enum ExcelColor

java.lang.Object
  extended by java.lang.Enum<ExcelColor>
      extended by net.sf.jett.model.ExcelColor
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ExcelColor>

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".

Since:
0.4.0
Author:
Randy Gettman
See Also:
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

Enum Constant Summary
AQUA
           
AUTOMATIC
           
BLACK
           
BLUE
           
BLUEGREY
           
BRIGHTGREEN
           
BROWN
           
CORAL
           
CORNFLOWERBLUE
           
DARKBLUE
           
DARKGREEN
           
DARKRED
           
DARKTEAL
           
DARKYELLOW
           
GOLD
           
GREEN
           
GREY25PERCENT
           
GREY40PERCENT
           
GREY50PERCENT
           
GREY80PERCENT
           
INDIGO
           
LAVENDER
           
LEMONCHIFFON
           
LIGHTBLUE
           
LIGHTCORNFLOWERBLUE
           
LIGHTGREEN
           
LIGHTORANGE
           
LIGHTTURQUOISE
           
LIGHTYELLOW
           
LIME
           
MAROON
           
OLIVEGREEN
           
ORANGE
           
ORCHID
           
PALEBLUE
           
PINK
           
PLUM
           
RED
           
ROSE
           
ROYALBLUE
           
SEAGREEN
           
SKYBLUE
           
TAN
           
TEAL
           
TURQUOISE
           
VIOLET
           
WHITE
           
YELLOW
           
 
Method Summary
 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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AQUA

public static final ExcelColor AQUA

AUTOMATIC

public static final ExcelColor AUTOMATIC

BLACK

public static final ExcelColor BLACK

BLUE

public static final ExcelColor BLUE

BLUEGREY

public static final ExcelColor BLUEGREY

BRIGHTGREEN

public static final ExcelColor BRIGHTGREEN

BROWN

public static final ExcelColor BROWN

CORAL

public static final ExcelColor CORAL

CORNFLOWERBLUE

public static final ExcelColor CORNFLOWERBLUE

DARKBLUE

public static final ExcelColor DARKBLUE

DARKGREEN

public static final ExcelColor DARKGREEN

DARKRED

public static final ExcelColor DARKRED

DARKTEAL

public static final ExcelColor DARKTEAL

DARKYELLOW

public static final ExcelColor DARKYELLOW

GOLD

public static final ExcelColor GOLD

GREEN

public static final ExcelColor GREEN

GREY25PERCENT

public static final ExcelColor GREY25PERCENT

GREY40PERCENT

public static final ExcelColor GREY40PERCENT

GREY50PERCENT

public static final ExcelColor GREY50PERCENT

GREY80PERCENT

public static final ExcelColor GREY80PERCENT

INDIGO

public static final ExcelColor INDIGO

LAVENDER

public static final ExcelColor LAVENDER

LEMONCHIFFON

public static final ExcelColor LEMONCHIFFON

LIGHTBLUE

public static final ExcelColor LIGHTBLUE

LIGHTCORNFLOWERBLUE

public static final ExcelColor LIGHTCORNFLOWERBLUE

LIGHTGREEN

public static final ExcelColor LIGHTGREEN

LIGHTORANGE

public static final ExcelColor LIGHTORANGE

LIGHTTURQUOISE

public static final ExcelColor LIGHTTURQUOISE

LIGHTYELLOW

public static final ExcelColor LIGHTYELLOW

LIME

public static final ExcelColor LIME

MAROON

public static final ExcelColor MAROON

OLIVEGREEN

public static final ExcelColor OLIVEGREEN

ORANGE

public static final ExcelColor ORANGE

ORCHID

public static final ExcelColor ORCHID

PALEBLUE

public static final ExcelColor PALEBLUE

PINK

public static final ExcelColor PINK

PLUM

public static final ExcelColor PLUM

RED

public static final ExcelColor RED

ROSE

public static final ExcelColor ROSE

ROYALBLUE

public static final ExcelColor ROYALBLUE

SEAGREEN

public static final ExcelColor SEAGREEN

SKYBLUE

public static final ExcelColor SKYBLUE

TAN

public static final ExcelColor TAN

TEAL

public static final ExcelColor TEAL

TURQUOISE

public static final ExcelColor TURQUOISE

VIOLET

public static final ExcelColor VIOLET

WHITE

public static final ExcelColor WHITE

YELLOW

public static final ExcelColor YELLOW
Method Detail

values

public static final ExcelColor[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ExcelColor c : ExcelColor.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static ExcelColor valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getHssfColor

public org.apache.poi.hssf.util.HSSFColor getHssfColor()
Return the HSSFColor.

Returns:
The HSSFColor.

getXssfColor

public org.apache.poi.xssf.usermodel.XSSFColor getXssfColor()
Return the XSSFColor.

Returns:
The XSSFColor.

getIndex

public int getIndex()
Returns the index.

Returns:
The index.

getIndexedColor

public org.apache.poi.ss.usermodel.IndexedColors getIndexedColor()
Returns the IndexedColors.

Returns:
The IndexedColors.

getRed

public int getRed()
Returns the red value, 0-255.

Returns:
The red value, 0-255.

getGreen

public int getGreen()
Returns the green value, 0-255.

Returns:
The green value, 0-255.

getBlue

public int getBlue()
Returns the blue value, 0-255.

Returns:
The blue value, 0-255.

getHexString

public java.lang.String getHexString()
Returns the hex string, in the format "#RRGGBB".

Returns:
The hex string, in the format "#RRGGBB".

distance

public 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.

Parameters:
red - The red value.
green - The green value.
blue - The blue value.
Returns:
The sum of each of the differences for the red, green, and blue values.

toString

public java.lang.String toString()
Returns the color name, in all lowercase, no underscores or spaces.

Overrides:
toString in class java.lang.Enum<ExcelColor>
Returns:
The color name, in all lowercase, no underscores or spaces.

getHssfColorByIndex

public static org.apache.poi.hssf.util.HSSFColor getHssfColorByIndex(short index)
Maps a short index color back to an HSSFColor.

Parameters:
index - A short color index.
Returns:
An HSSFColor.


Copyright © 2012-2013 Jett Team. All Rights Reserved.