|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.poi.ss.usermodel.ExtendedColor
org.apache.poi.hssf.usermodel.HSSFExtendedColor
public class HSSFExtendedColor
The HSSF file format normally stores Color information in the Palette (see PaletteRecord), but for a few cases (eg Conditional Formatting, Sheet Extensions), this XSSF-style color record can be used.
| Constructor Summary | |
|---|---|
HSSFExtendedColor(ExtendedColor color)
|
|
| Method Summary | |
|---|---|
byte[] |
getARGB()
|
protected ExtendedColor |
getExtendedColor()
|
short |
getIndex()
|
protected byte[] |
getIndexedRGB()
|
byte[] |
getRGB()
|
protected byte[] |
getStoredRBG()
|
int |
getTheme()
|
double |
getTint()
Specifies the tint value applied to the ctColor. |
boolean |
isAuto()
|
boolean |
isIndexed()
|
boolean |
isRGB()
|
boolean |
isThemed()
|
void |
setRGB(byte[] rgb)
Sets the Red Green Blue or Alpha Red Green Blue |
void |
setTint(double tint)
Specifies the tint value applied to the ctColor. |
| Methods inherited from class org.apache.poi.ss.usermodel.ExtendedColor |
|---|
getARGBHex, getRGBOrARGB, getRGBWithTint, setARGBHex, setColor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HSSFExtendedColor(ExtendedColor color)
| Method Detail |
|---|
protected ExtendedColor getExtendedColor()
public boolean isAuto()
isAuto in class ExtendedColorpublic boolean isIndexed()
isIndexed in class ExtendedColorpublic boolean isRGB()
isRGB in class ExtendedColorpublic boolean isThemed()
isThemed in class ExtendedColorpublic short getIndex()
getIndex in class ExtendedColorExtendedColor.isIndexed() is truepublic int getTheme()
getTheme in class ExtendedColorExtendedColor.isThemed() is truepublic byte[] getRGB()
getRGB in class ExtendedColorpublic byte[] getARGB()
getARGB in class ExtendedColorprotected byte[] getStoredRBG()
getStoredRBG in class ExtendedColorpublic void setRGB(byte[] rgb)
ExtendedColor
setRGB in class ExtendedColorrgb - bytespublic double getTint()
ExtendedColorIf tint is supplied, then it is applied to the RGB value of the ctColor to determine the final ctColor applied.
The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
In loading the RGB value, it is converted to HLS where HLS values are (0..HLSMAX), where HLSMAX is currently 255.
Here are some examples of how to apply tint to ctColor:If (tint < 0) Lum' = Lum * (1.0 + tint) For example: Lum = 200; tint = -0.5; Darken 50% Lum' = 200 * (0.5) => 100 For example: Lum = 200; tint = -1.0; Darken 100% (make black) Lum' = 200 * (1.0-1.0) => 0 If (tint > 0) Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint)) For example: Lum = 100; tint = 0.75; Lighten 75% Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75)) = 100 * .25 + (255 - 255 * .25) = 25 + (255 - 63) = 25 + 192 = 217 For example: Lum = 100; tint = 1.0; Lighten 100% (make white) Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1)) = 100 * 0 + (255 - 255 * 0) = 0 + (255 - 0) = 255
getTint in class ExtendedColorpublic void setTint(double tint)
ExtendedColorIf tint is supplied, then it is applied to the RGB value of the ctColor to determine the final ctColor applied.
The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
In loading the RGB value, it is converted to HLS where HLS values are (0..HLSMAX), where HLSMAX is currently 255.
Here are some examples of how to apply tint to ctColor:If (tint < 0) Lum' = Lum * (1.0 + tint) For example: Lum = 200; tint = -0.5; Darken 50% Lum' = 200 * (0.5) => 100 For example: Lum = 200; tint = -1.0; Darken 100% (make black) Lum' = 200 * (1.0-1.0) => 0 If (tint > 0) Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint)) For example: Lum = 100; tint = 0.75; Lighten 75% Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75)) = 100 * .25 + (255 - 255 * .25) = 25 + (255 - 63) = 25 + 192 = 217 For example: Lum = 100; tint = 1.0; Lighten 100% (make white) Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1)) = 100 * 0 + (255 - 255 * 0) = 0 + (255 - 0) = 255
setTint in class ExtendedColortint - the tint valueprotected byte[] getIndexedRGB()
getIndexedRGB in class ExtendedColorExtendedColor.isIndexed() == true, null if not indexed or index is invalid
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||