public final class HSSFPalette
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
HSSFPalette(PaletteRecord palette) |
Modifier and Type | Method and Description |
---|---|
HSSFColor |
addColor(byte red,
byte green,
byte blue)
Adds a new color into an empty color slot.
|
HSSFColor |
findColor(byte red,
byte green,
byte blue)
Finds the first occurance of a given color
|
HSSFColor |
findSimilarColor(byte red,
byte green,
byte blue)
Finds the closest matching color in the custom palette.
|
HSSFColor |
findSimilarColor(int red,
int green,
int blue)
Finds the closest matching color in the custom palette.
|
HSSFColor |
getColor(int index)
Retrieves the color at a given index
|
HSSFColor |
getColor(short index)
Retrieves the color at a given index
|
void |
setColorAtIndex(short index,
byte red,
byte green,
byte blue)
Sets the color at the given offset
|
protected HSSFPalette(PaletteRecord palette)
public HSSFColor getColor(short index)
index
- the palette index, between 0x8 to 0x40 inclusivepublic HSSFColor getColor(int index)
index
- the palette index, between 0x8 to 0x40 inclusivepublic HSSFColor findColor(byte red, byte green, byte blue)
red
- the RGB red component, between 0 and 255 inclusivegreen
- the RGB green component, between 0 and 255 inclusiveblue
- the RGB blue component, between 0 and 255 inclusivepublic HSSFColor findSimilarColor(byte red, byte green, byte blue)
red
- The red component of the color to match.green
- The green component of the color to match.blue
- The blue component of the color to match.public HSSFColor findSimilarColor(int red, int green, int blue)
red
- The red component of the color to match.green
- The green component of the color to match.blue
- The blue component of the color to match.public void setColorAtIndex(short index, byte red, byte green, byte blue)
index
- the palette index, between 0x8 to 0x40 inclusivered
- the RGB red component, between 0 and 255 inclusivegreen
- the RGB green component, between 0 and 255 inclusiveblue
- the RGB blue component, between 0 and 255 inclusivepublic HSSFColor addColor(byte red, byte green, byte blue)
red
- The red componentgreen
- The green componentblue
- The blue componentjava.lang.RuntimeException
- if there are more more free color indexes.Copyright © 2005-2010 Potix Corporation. All Rights Reserved.