|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.HSSFPalette
public class HSSFPalette
Represents a workbook color palette. Internally, the XLS format refers to colors using an offset into the palette record. Thus, the first color in the palette has the index 0x8, the second has the index 0x9, etc. through 0x40
Constructor Summary | |
---|---|
protected |
HSSFPalette(PaletteRecord palette)
|
Method Summary | |
---|---|
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 |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected HSSFPalette(PaletteRecord palette)
Method Detail |
---|
public HSSFColor getColor(short index)
index
- the palette index, between 0x8 to 0x40 inclusive
public 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 inclusive
public 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 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 component
java.lang.RuntimeException
- if there are more more free color indexes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |