com.jrefinery.workbook
Class StyleColor

java.lang.Object
  |
  +--com.jrefinery.workbook.StyleColor

public class StyleColor
extends java.lang.Object

Represents a color within a style.


Field Summary
static int BACKGROUND_COLOR
          Constant representing the background color.
protected  int blue
          Blue component.
static int EXCEL_AQUA
          Useful constant representing the standard Excel color AQUA.
static int EXCEL_BLACK
          Useful constant representing the standard Excel color BLACK.
static int EXCEL_BLUE
          Useful constant representing the standard Excel color BLUE.
static int EXCEL_BLUE_GRAY
          Useful constant representing the standard Excel color BLUE_GRAY.
static int EXCEL_BRIGHT_GREEN
          Useful constant representing the standard Excel color BRIGHT_GREEN.
static int EXCEL_BROWN
          Useful constant representing the standard Excel color BROWN.
static int EXCEL_DARK_BLUE
          Useful constant representing the standard Excel color DARK_BLUE.
static int EXCEL_DARK_GREEN
          Useful constant representing the standard Excel color DARK_GREEN.
static int EXCEL_DARK_RED
          Useful constant representing the standard Excel color DARK_RED.
static int EXCEL_DARK_TEAL
          Useful constant representing the standard Excel color DARK_TEAL.
static int EXCEL_DARK_YELLOW
          Useful constant representing the standard Excel color DARK_YELLOW.
static int EXCEL_GOLD
          Useful constant representing the standard Excel color GOLD.
static int EXCEL_GRAY_25PERCENT
          Useful constant representing the standard Excel color GRAY_25PERCENT.
static int EXCEL_GRAY_40PERCENT
          Useful constant representing the standard Excel color GRAY_40PERCENT.
static int EXCEL_GRAY_50PERCENT
          Useful constant representing the standard Excel color GRAY_50PERCENT.
static int EXCEL_GRAY_80PERCENT
          Useful constant representing the standard Excel color GRAY_80PERCENT.
static int EXCEL_GREEN
          Useful constant representing the standard Excel color GREEN.
static int EXCEL_INDIGO
          Useful constant representing the standard Excel color INDIGO.
static int EXCEL_LAVENDER
          Useful constant representing the standard Excel color LAVENDER.
static int EXCEL_LIGHT_BLUE
          Useful constant representing the standard Excel color LIGHT_BLUE.
static int EXCEL_LIGHT_GREEN
          Useful constant representing the standard Excel color LIGHT_GREEN.
static int EXCEL_LIGHT_ORANGE
          Useful constant representing the standard Excel color LIGHT_ORANGE.
static int EXCEL_LIGHT_TURQUOISE
          Useful constant representing the standard Excel color LIGHT_TURQUOISE.
static int EXCEL_LIGHT_YELLOW
          Useful constant representing the standard Excel color LIGHT_YELLOW.
static int EXCEL_LIME
          Useful constant representing the standard Excel color LIME.
static int EXCEL_OLIVE_GREEN
          Useful constant representing the standard Excel color OLIVE_GREEN.
static int EXCEL_ORANGE
          Useful constant representing the standard Excel color ORANGE.
static int EXCEL_PALE_BLUE
          Useful constant representing the standard Excel color PALE_BLUE.
static int EXCEL_PINK
          Useful constant representing the standard Excel color PINK.
static int EXCEL_PLUM
          Useful constant representing the standard Excel color PLUM.
static int EXCEL_RED
          Useful constant representing the standard Excel color RED.
static int EXCEL_ROSE
          Useful constant representing the standard Excel color ROSE.
static int EXCEL_SEA_GREEN
          Useful constant representing the standard Excel color SEA_GREEN.
static int EXCEL_SKY_BLUE
          Useful constant representing the standard Excel color SKY_BLUE.
static int EXCEL_TAN
          Useful constant representing the standard Excel color TAN.
static int EXCEL_TEAL
          Useful constant representing the standard Excel color TEAL.
static int EXCEL_TURQUOISE
          Useful constant representing the standard Excel color TURQUOISE.
static int EXCEL_VIOLET
          Useful constant representing the standard Excel color VIOLET.
static int EXCEL_WHITE
          Useful constant representing the standard Excel color WHITE.
static int EXCEL_YELLOW
          Useful constant representing the standard Excel color YELLOW.
static int FOREGROUND_COLOR
          Constant representing the foreground color.
static int GNUMERIC_BLACK
          Useful constant representing the standard Gnumeric color BLACK.
static int GNUMERIC_BLUE
          Useful constant representing the standard Gnumeric color BLUE.
static int GNUMERIC_BRIGHT_BLUE
          Useful constant representing the standard Gnumeric color BRIGHT_BLUE.
static int GNUMERIC_BRIGHT_ORANGE
          Useful constant representing the standard Gnumeric color BRIGHT_ORANGE.
static int GNUMERIC_BROWN_GOLD
          Useful constant representing the standard Gnumeric color BROWN_GOLD.
static int GNUMERIC_CYAN
          Useful constant representing the standard Gnumeric color CYAN.
static int GNUMERIC_DARK_BLUE
          Useful constant representing the standard Gnumeric color DARK_BLUE.
static int GNUMERIC_DARK_GRAY
          Useful constant representing the standard Gnumeric color DARK_GRAY.
static int GNUMERIC_DARK_GREEN
          Useful constant representing the standard Gnumeric color DARK_GREEN.
static int GNUMERIC_DARK_GREEN_2
          Useful constant representing the standard Gnumeric color DARK_GREEN_2.
static int GNUMERIC_DARK_RED
          Useful constant representing the standard Gnumeric color DARK_RED.
static int GNUMERIC_DULL_BLUE
          Useful constant representing the standard Gnumeric color DULL_BLUE.
static int GNUMERIC_DULL_BLUE_2
          Useful constant representing the standard Gnumeric color DULL_BLUE_2.
static int GNUMERIC_DULL_GREEN
          Useful constant representing the standard Gnumeric color DULL_GREEN.
static int GNUMERIC_DULL_PURPLE
          Useful constant representing the standard Gnumeric color DULL_PURPLE.
static int GNUMERIC_GOLD
          Useful constant representing the standard Gnumeric color GOLD.
static int GNUMERIC_GRAY
          Useful constant representing the standard Gnumeric color GRAY.
static int GNUMERIC_GREEN
          Useful constant representing the standard Gnumeric color GREEN.
static int GNUMERIC_LIGHT_BLUE
          Useful constant representing the standard Gnumeric color LIGHT_BLUE.
static int GNUMERIC_LIGHT_BROWN
          Useful constant representing the standard Gnumeric color LIGHT_BROWN.
static int GNUMERIC_LIGHT_CYAN
          Useful constant representing the standard Gnumeric color LIGHT_CYAN.
static int GNUMERIC_LIGHT_GRAY
          Useful constant representing the standard Gnumeric color LIGHT_GRAY.
static int GNUMERIC_LIGHT_GREEN
          Useful constant representing the standard Gnumeric color LIGHT_GREEN.
static int GNUMERIC_LIGHT_ORANGE
          Useful constant representing the standard Gnumeric color LIGHT_ORANGE.
static int GNUMERIC_LIGHT_PURPLE
          Useful constant representing the standard Gnumeric color LIGHT_PURPLE.
static int GNUMERIC_LIGHT_YELLOW
          Useful constant representing the standard Gnumeric color LIGHT_YELLOW.
static int GNUMERIC_LIME
          Useful constant representing the standard Gnumeric color LIME.
static int GNUMERIC_MAGENTA
          Useful constant representing the standard Gnumeric color MAGENTA.
static int GNUMERIC_NAVY
          Useful constant representing the standard Gnumeric color NAVY.
static int GNUMERIC_ORANGE
          Useful constant representing the standard Gnumeric color ORANGE.
static int GNUMERIC_PINK
          Useful constant representing the standard Gnumeric color PINK.
static int GNUMERIC_PURPLE
          Useful constant representing the standard Gnumeric color PURPLE.
static int GNUMERIC_PURPLE_2
          Useful constant representing the standard Gnumeric color PURPLE_2.
static int GNUMERIC_RED
          Useful constant representing the standard Gnumeric color RED.
static int GNUMERIC_RED_ORANGE
          Useful constant representing the standard Gnumeric color RED_ORANGE.
static int GNUMERIC_RED_PURPLE
          Useful constant representing the standard Gnumeric color RED_PURPLE.
static int GNUMERIC_SKY_BLUE_2
          Useful constant representing the standard Gnumeric color SKY_BLUE_2.
static int GNUMERIC_VERY_DARK_GRAY
          Useful constant representing the standard Gnumeric color VERY_DARK_GRAY.
static int GNUMERIC_WHITE
          Useful constant representing the standard Gnumeric color WHITE.
static int GNUMERIC_YELLOW
          Useful constant representing the standard Gnumeric color YELLOW.
protected  int green
          Green component.
static int PATTERN_COLOR
          Constant representing the pattern color.
protected  int red
          Red component.
 
Constructor Summary
StyleColor(int red, int green, int blue)
          Standard constructor: creates a StyleColor with the specified red, green and blue components.
 
Method Summary
static StyleColor createInstance(int colorCode)
          Returns one of the standard Excel or Gnumeric colors.
 int getBlue()
          Returns the blue component of the color.
 int getGreen()
          Returns the green component of the color.
 int getRed()
          Returns the red component of the color.
 java.lang.String toString()
          Returns the color as a string in the format required by Gnumeric.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FOREGROUND_COLOR

public static final int FOREGROUND_COLOR
Constant representing the foreground color.

BACKGROUND_COLOR

public static final int BACKGROUND_COLOR
Constant representing the background color.

PATTERN_COLOR

public static final int PATTERN_COLOR
Constant representing the pattern color.

GNUMERIC_BLACK

public static final int GNUMERIC_BLACK
Useful constant representing the standard Gnumeric color BLACK.

GNUMERIC_LIGHT_BROWN

public static final int GNUMERIC_LIGHT_BROWN
Useful constant representing the standard Gnumeric color LIGHT_BROWN.

GNUMERIC_BROWN_GOLD

public static final int GNUMERIC_BROWN_GOLD
Useful constant representing the standard Gnumeric color BROWN_GOLD.

GNUMERIC_DARK_GREEN_2

public static final int GNUMERIC_DARK_GREEN_2
Useful constant representing the standard Gnumeric color DARK_GREEN_2.

GNUMERIC_NAVY

public static final int GNUMERIC_NAVY
Useful constant representing the standard Gnumeric color NAVY.

GNUMERIC_DARK_BLUE

public static final int GNUMERIC_DARK_BLUE
Useful constant representing the standard Gnumeric color DARK_BLUE.

GNUMERIC_PURPLE_2

public static final int GNUMERIC_PURPLE_2
Useful constant representing the standard Gnumeric color PURPLE_2.

GNUMERIC_VERY_DARK_GRAY

public static final int GNUMERIC_VERY_DARK_GRAY
Useful constant representing the standard Gnumeric color VERY_DARK_GRAY.

GNUMERIC_DARK_RED

public static final int GNUMERIC_DARK_RED
Useful constant representing the standard Gnumeric color DARK_RED.

GNUMERIC_RED_ORANGE

public static final int GNUMERIC_RED_ORANGE
Useful constant representing the standard Gnumeric color RED_ORANGE.

GNUMERIC_GOLD

public static final int GNUMERIC_GOLD
Useful constant representing the standard Gnumeric color GOLD.

GNUMERIC_DARK_GREEN

public static final int GNUMERIC_DARK_GREEN
Useful constant representing the standard Gnumeric color DARK_GREEN.

GNUMERIC_DULL_BLUE

public static final int GNUMERIC_DULL_BLUE
Useful constant representing the standard Gnumeric color DULL_BLUE.

GNUMERIC_BLUE

public static final int GNUMERIC_BLUE
Useful constant representing the standard Gnumeric color BLUE.

GNUMERIC_DULL_PURPLE

public static final int GNUMERIC_DULL_PURPLE
Useful constant representing the standard Gnumeric color DULL_PURPLE.

GNUMERIC_DARK_GRAY

public static final int GNUMERIC_DARK_GRAY
Useful constant representing the standard Gnumeric color DARK_GRAY.

GNUMERIC_RED

public static final int GNUMERIC_RED
Useful constant representing the standard Gnumeric color RED.

GNUMERIC_ORANGE

public static final int GNUMERIC_ORANGE
Useful constant representing the standard Gnumeric color ORANGE.

GNUMERIC_LIME

public static final int GNUMERIC_LIME
Useful constant representing the standard Gnumeric color LIME.

GNUMERIC_DULL_GREEN

public static final int GNUMERIC_DULL_GREEN
Useful constant representing the standard Gnumeric color DULL_GREEN.

GNUMERIC_DULL_BLUE_2

public static final int GNUMERIC_DULL_BLUE_2
Useful constant representing the standard Gnumeric color DULL_BLUE_2.

GNUMERIC_SKY_BLUE_2

public static final int GNUMERIC_SKY_BLUE_2
Useful constant representing the standard Gnumeric color SKY_BLUE_2.

GNUMERIC_PURPLE

public static final int GNUMERIC_PURPLE
Useful constant representing the standard Gnumeric color PURPLE.

GNUMERIC_GRAY

public static final int GNUMERIC_GRAY
Useful constant representing the standard Gnumeric color GRAY.

GNUMERIC_MAGENTA

public static final int GNUMERIC_MAGENTA
Useful constant representing the standard Gnumeric color MAGENTA.

GNUMERIC_BRIGHT_ORANGE

public static final int GNUMERIC_BRIGHT_ORANGE
Useful constant representing the standard Gnumeric color BRIGHT_ORANGE.

GNUMERIC_YELLOW

public static final int GNUMERIC_YELLOW
Useful constant representing the standard Gnumeric color YELLOW.

GNUMERIC_GREEN

public static final int GNUMERIC_GREEN
Useful constant representing the standard Gnumeric color GREEN.

GNUMERIC_CYAN

public static final int GNUMERIC_CYAN
Useful constant representing the standard Gnumeric color CYAN.

GNUMERIC_BRIGHT_BLUE

public static final int GNUMERIC_BRIGHT_BLUE
Useful constant representing the standard Gnumeric color BRIGHT_BLUE.

GNUMERIC_RED_PURPLE

public static final int GNUMERIC_RED_PURPLE
Useful constant representing the standard Gnumeric color RED_PURPLE.

GNUMERIC_LIGHT_GRAY

public static final int GNUMERIC_LIGHT_GRAY
Useful constant representing the standard Gnumeric color LIGHT_GRAY.

GNUMERIC_PINK

public static final int GNUMERIC_PINK
Useful constant representing the standard Gnumeric color PINK.

GNUMERIC_LIGHT_ORANGE

public static final int GNUMERIC_LIGHT_ORANGE
Useful constant representing the standard Gnumeric color LIGHT_ORANGE.

GNUMERIC_LIGHT_YELLOW

public static final int GNUMERIC_LIGHT_YELLOW
Useful constant representing the standard Gnumeric color LIGHT_YELLOW.

GNUMERIC_LIGHT_GREEN

public static final int GNUMERIC_LIGHT_GREEN
Useful constant representing the standard Gnumeric color LIGHT_GREEN.

GNUMERIC_LIGHT_CYAN

public static final int GNUMERIC_LIGHT_CYAN
Useful constant representing the standard Gnumeric color LIGHT_CYAN.

GNUMERIC_LIGHT_BLUE

public static final int GNUMERIC_LIGHT_BLUE
Useful constant representing the standard Gnumeric color LIGHT_BLUE.

GNUMERIC_LIGHT_PURPLE

public static final int GNUMERIC_LIGHT_PURPLE
Useful constant representing the standard Gnumeric color LIGHT_PURPLE.

GNUMERIC_WHITE

public static final int GNUMERIC_WHITE
Useful constant representing the standard Gnumeric color WHITE.

EXCEL_BLACK

public static final int EXCEL_BLACK
Useful constant representing the standard Excel color BLACK.

EXCEL_BROWN

public static final int EXCEL_BROWN
Useful constant representing the standard Excel color BROWN.

EXCEL_OLIVE_GREEN

public static final int EXCEL_OLIVE_GREEN
Useful constant representing the standard Excel color OLIVE_GREEN.

EXCEL_DARK_GREEN

public static final int EXCEL_DARK_GREEN
Useful constant representing the standard Excel color DARK_GREEN.

EXCEL_DARK_TEAL

public static final int EXCEL_DARK_TEAL
Useful constant representing the standard Excel color DARK_TEAL.

EXCEL_DARK_BLUE

public static final int EXCEL_DARK_BLUE
Useful constant representing the standard Excel color DARK_BLUE.

EXCEL_INDIGO

public static final int EXCEL_INDIGO
Useful constant representing the standard Excel color INDIGO.

EXCEL_GRAY_80PERCENT

public static final int EXCEL_GRAY_80PERCENT
Useful constant representing the standard Excel color GRAY_80PERCENT.

EXCEL_DARK_RED

public static final int EXCEL_DARK_RED
Useful constant representing the standard Excel color DARK_RED.

EXCEL_ORANGE

public static final int EXCEL_ORANGE
Useful constant representing the standard Excel color ORANGE.

EXCEL_DARK_YELLOW

public static final int EXCEL_DARK_YELLOW
Useful constant representing the standard Excel color DARK_YELLOW.

EXCEL_GREEN

public static final int EXCEL_GREEN
Useful constant representing the standard Excel color GREEN.

EXCEL_TEAL

public static final int EXCEL_TEAL
Useful constant representing the standard Excel color TEAL.

EXCEL_BLUE

public static final int EXCEL_BLUE
Useful constant representing the standard Excel color BLUE.

EXCEL_BLUE_GRAY

public static final int EXCEL_BLUE_GRAY
Useful constant representing the standard Excel color BLUE_GRAY.

EXCEL_GRAY_50PERCENT

public static final int EXCEL_GRAY_50PERCENT
Useful constant representing the standard Excel color GRAY_50PERCENT.

EXCEL_RED

public static final int EXCEL_RED
Useful constant representing the standard Excel color RED.

EXCEL_LIGHT_ORANGE

public static final int EXCEL_LIGHT_ORANGE
Useful constant representing the standard Excel color LIGHT_ORANGE.

EXCEL_LIME

public static final int EXCEL_LIME
Useful constant representing the standard Excel color LIME.

EXCEL_SEA_GREEN

public static final int EXCEL_SEA_GREEN
Useful constant representing the standard Excel color SEA_GREEN.

EXCEL_AQUA

public static final int EXCEL_AQUA
Useful constant representing the standard Excel color AQUA.

EXCEL_LIGHT_BLUE

public static final int EXCEL_LIGHT_BLUE
Useful constant representing the standard Excel color LIGHT_BLUE.

EXCEL_VIOLET

public static final int EXCEL_VIOLET
Useful constant representing the standard Excel color VIOLET.

EXCEL_GRAY_40PERCENT

public static final int EXCEL_GRAY_40PERCENT
Useful constant representing the standard Excel color GRAY_40PERCENT.

EXCEL_PINK

public static final int EXCEL_PINK
Useful constant representing the standard Excel color PINK.

EXCEL_GOLD

public static final int EXCEL_GOLD
Useful constant representing the standard Excel color GOLD.

EXCEL_YELLOW

public static final int EXCEL_YELLOW
Useful constant representing the standard Excel color YELLOW.

EXCEL_BRIGHT_GREEN

public static final int EXCEL_BRIGHT_GREEN
Useful constant representing the standard Excel color BRIGHT_GREEN.

EXCEL_TURQUOISE

public static final int EXCEL_TURQUOISE
Useful constant representing the standard Excel color TURQUOISE.

EXCEL_SKY_BLUE

public static final int EXCEL_SKY_BLUE
Useful constant representing the standard Excel color SKY_BLUE.

EXCEL_PLUM

public static final int EXCEL_PLUM
Useful constant representing the standard Excel color PLUM.

EXCEL_GRAY_25PERCENT

public static final int EXCEL_GRAY_25PERCENT
Useful constant representing the standard Excel color GRAY_25PERCENT.

EXCEL_ROSE

public static final int EXCEL_ROSE
Useful constant representing the standard Excel color ROSE.

EXCEL_TAN

public static final int EXCEL_TAN
Useful constant representing the standard Excel color TAN.

EXCEL_LIGHT_YELLOW

public static final int EXCEL_LIGHT_YELLOW
Useful constant representing the standard Excel color LIGHT_YELLOW.

EXCEL_LIGHT_GREEN

public static final int EXCEL_LIGHT_GREEN
Useful constant representing the standard Excel color LIGHT_GREEN.

EXCEL_LIGHT_TURQUOISE

public static final int EXCEL_LIGHT_TURQUOISE
Useful constant representing the standard Excel color LIGHT_TURQUOISE.

EXCEL_PALE_BLUE

public static final int EXCEL_PALE_BLUE
Useful constant representing the standard Excel color PALE_BLUE.

EXCEL_LAVENDER

public static final int EXCEL_LAVENDER
Useful constant representing the standard Excel color LAVENDER.

EXCEL_WHITE

public static final int EXCEL_WHITE
Useful constant representing the standard Excel color WHITE.

red

protected int red
Red component.

green

protected int green
Green component.

blue

protected int blue
Blue component.
Constructor Detail

StyleColor

public StyleColor(int red,
                  int green,
                  int blue)
Standard constructor: creates a StyleColor with the specified red, green and blue components.
Parameters:
red - The red component.
green - The green component.
blue - The blue component.
Method Detail

getRed

public int getRed()
Returns the red component of the color.
Returns:
The red component of the color.

getGreen

public int getGreen()
Returns the green component of the color.
Returns:
The green component of the color.

getBlue

public int getBlue()
Returns the blue component of the color.
Returns:
The blue component of the color.

createInstance

public static StyleColor createInstance(int colorCode)
Returns one of the standard Excel or Gnumeric colors.
Parameters:
colorCode - Code for one of the standard colors. If an unrecognised code is used, the method returns the color EXCEL_WHITE.
Returns:
One of the standard Excel or Gnumeric colors.

toString

public java.lang.String toString()
Returns the color as a string in the format required by Gnumeric.
Overrides:
toString in class java.lang.Object
Returns:
The color as a string in the format required by Gnumeric.