org.jfree.workbook
Class Color

java.lang.Object
  |
  +--org.jfree.workbook.Color
All Implemented Interfaces:
ColorConstants

public class Color
extends java.lang.Object
implements ColorConstants

Represents a color within a style.


Field Summary
protected  int blue
          Blue component.
protected  int green
          Green component.
protected  int red
          Red component.
 
Fields inherited from interface org.jfree.workbook.ColorConstants
BACKGROUND_COLOR, BLACK, EXCEL_AQUA, EXCEL_BLACK, EXCEL_BLUE, EXCEL_BLUE_GRAY, EXCEL_BRIGHT_GREEN, EXCEL_BROWN, EXCEL_DARK_BLUE, EXCEL_DARK_GREEN, EXCEL_DARK_RED, EXCEL_DARK_TEAL, EXCEL_DARK_YELLOW, EXCEL_GOLD, EXCEL_GRAY_25PERCENT, EXCEL_GRAY_40PERCENT, EXCEL_GRAY_50PERCENT, EXCEL_GRAY_80PERCENT, EXCEL_GREEN, EXCEL_INDIGO, EXCEL_LAVENDER, EXCEL_LIGHT_BLUE, EXCEL_LIGHT_GREEN, EXCEL_LIGHT_ORANGE, EXCEL_LIGHT_TURQUOISE, EXCEL_LIGHT_YELLOW, EXCEL_LIME, EXCEL_OLIVE_GREEN, EXCEL_ORANGE, EXCEL_PALE_BLUE, EXCEL_PINK, EXCEL_PLUM, EXCEL_RED, EXCEL_ROSE, EXCEL_SEA_GREEN, EXCEL_SKY_BLUE, EXCEL_TAN, EXCEL_TEAL, EXCEL_TURQUOISE, EXCEL_VIOLET, EXCEL_WHITE, EXCEL_YELLOW, FOREGROUND_COLOR, GNUMERIC_BLACK, GNUMERIC_BLUE, GNUMERIC_BRIGHT_BLUE, GNUMERIC_BRIGHT_ORANGE, GNUMERIC_BROWN_GOLD, GNUMERIC_CYAN, GNUMERIC_DARK_BLUE, GNUMERIC_DARK_GRAY, GNUMERIC_DARK_GREEN, GNUMERIC_DARK_GREEN_2, GNUMERIC_DARK_RED, GNUMERIC_DULL_BLUE, GNUMERIC_DULL_BLUE_2, GNUMERIC_DULL_GREEN, GNUMERIC_DULL_PURPLE, GNUMERIC_GOLD, GNUMERIC_GRAY, GNUMERIC_GREEN, GNUMERIC_LIGHT_BLUE, GNUMERIC_LIGHT_BROWN, GNUMERIC_LIGHT_CYAN, GNUMERIC_LIGHT_GRAY, GNUMERIC_LIGHT_GREEN, GNUMERIC_LIGHT_ORANGE, GNUMERIC_LIGHT_PURPLE, GNUMERIC_LIGHT_YELLOW, GNUMERIC_LIME, GNUMERIC_MAGENTA, GNUMERIC_NAVY, GNUMERIC_ORANGE, GNUMERIC_PINK, GNUMERIC_PURPLE, GNUMERIC_PURPLE_2, GNUMERIC_RED, GNUMERIC_RED_ORANGE, GNUMERIC_RED_PURPLE, GNUMERIC_SKY_BLUE_2, GNUMERIC_VERY_DARK_GRAY, GNUMERIC_WHITE, GNUMERIC_YELLOW, PATTERN_COLOR, WHITE
 
Constructor Summary
Color(int red, int green, int blue)
          Constructs a Color with the specified red, green and blue components.
 
Method Summary
static Color 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

red

protected int red
Red component.


green

protected int green
Green component.


blue

protected int blue
Blue component.

Constructor Detail

Color

public Color(int red,
             int green,
             int blue)
Constructs a Color 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.

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.

createInstance

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