| java.lang.Object org.apache.poi.hssf.usermodel.HSSFPalette
HSSFPalette | public class HSSFPalette (Code) | | 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
author: Brian Sanders (bsanders at risklabs dot com) |
addColor | public HSSFColor addColor(byte red, byte green, byte blue)(Code) | | Adds a new color into an empty color slot.
Parameters: red - The red component Parameters: green - The green component Parameters: blue - The blue component The new custom color. throws: RuntimeException - if there are more more free color indexes. |
findColor | public HSSFColor findColor(byte red, byte green, byte blue)(Code) | | Finds the first occurance of a given color
Parameters: red - the RGB red component, between 0 and 255 inclusive Parameters: green - the RGB green component, between 0 and 255 inclusive Parameters: blue - the RGB blue component, between 0 and 255 inclusive the color, or null if the color does not exist in this palette |
findSimilarColor | public HSSFColor findSimilarColor(byte red, byte green, byte blue)(Code) | | Finds the closest matching color in the custom palette. The
method for finding the distance between the colors is fairly
primative.
Parameters: red - The red component of the color to match. Parameters: green - The green component of the color to match. Parameters: blue - The blue component of the color to match. The closest color or null if there are no customcolors currently defined. |
getColor | public HSSFColor getColor(short index)(Code) | | Retrieves the color at a given index
Parameters: index - the palette index, between 0x8 to 0x40 inclusive the color, or null if the index is not populated |
setColorAtIndex | public void setColorAtIndex(short index, byte red, byte green, byte blue)(Code) | | Sets the color at the given offset
Parameters: index - the palette index, between 0x8 to 0x40 inclusive Parameters: red - the RGB red component, between 0 and 255 inclusive Parameters: green - the RGB green component, between 0 and 255 inclusive Parameters: blue - the RGB blue component, between 0 and 255 inclusive |
|
|