|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.ss.usermodel.ExtendedColor
public abstract class ExtendedColor
Represents a XSSF-style color (based on either a
XSSFColor
or a
ExtendedColor
Constructor Summary | |
---|---|
ExtendedColor()
|
Method Summary | |
---|---|
abstract byte[] |
getARGB()
|
java.lang.String |
getARGBHex()
|
abstract short |
getIndex()
|
protected abstract byte[] |
getIndexedRGB()
|
abstract byte[] |
getRGB()
|
protected byte[] |
getRGBOrARGB()
|
byte[] |
getRGBWithTint()
|
protected abstract byte[] |
getStoredRBG()
|
abstract int |
getTheme()
|
abstract double |
getTint()
Specifies the tint value applied to the ctColor. |
abstract boolean |
isAuto()
|
abstract boolean |
isIndexed()
|
abstract boolean |
isRGB()
|
abstract boolean |
isThemed()
|
void |
setARGBHex(java.lang.String argb)
Sets the ARGB value from hex format, eg FF0077FF. |
protected void |
setColor(java.awt.Color clr)
|
abstract void |
setRGB(byte[] rgb)
Sets the Red Green Blue or Alpha Red Green Blue |
abstract void |
setTint(double tint)
Specifies the tint value applied to the ctColor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtendedColor()
Method Detail |
---|
protected void setColor(java.awt.Color clr)
clr
- awt Color to setpublic abstract boolean isAuto()
public abstract boolean isIndexed()
public abstract boolean isRGB()
public abstract boolean isThemed()
public abstract short getIndex()
isIndexed()
is truepublic abstract int getTheme()
isThemed()
is truepublic abstract byte[] getRGB()
public abstract byte[] getARGB()
protected abstract byte[] getStoredRBG()
public abstract void setRGB(byte[] rgb)
rgb
- bytesprotected byte[] getRGBOrARGB()
protected abstract byte[] getIndexedRGB()
isIndexed()
== true, null if not indexed or index is invalidpublic byte[] getRGBWithTint()
public java.lang.String getARGBHex()
public void setARGBHex(java.lang.String argb)
argb
- color ARGB hex stringpublic abstract double getTint()
If 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
public abstract void setTint(double tint)
If 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
tint
- the tint value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |