org.apache.poi.xssf.usermodel.XSSFColor or a
org.apache.poi.hssf.record.common.ExtendedColor
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static byte | |
| public abstract byte[] | |
| public String | Returns: the ARGB value in hex string format, eg FF00FF00. Works for both regular and indexed colours.
|
| public abstract short | |
| protected abstract byte[] | Returns: index color RGB bytes, ifisIndexed() == true, null if not indexed or index is invalid
|
| public abstract byte[] | Returns: Standard Red Green Blue ctColor value (RGB) bytes. If there was an A (Alpha) value, it will be stripped.
|
| protected byte[] | |
| public byte[] | Returns: Standard Red Green Blue ctColor value (RGB) bytes with applied tint. Alpha values are ignored.
|
| protected abstract byte[] | |
| public abstract int | |
| public abstract double | |
| public abstract boolean | |
| public abstract boolean | |
| public abstract boolean | |
| public abstract boolean | |
| public void | |
| protected void | |
| public abstract void | |
| public abstract void |
| ExtendedColor | back to summary |
|---|---|
| public ExtendedColor() | |
| applyTint | back to summary |
|---|---|
| private static byte applyTint(int lum, double tint) | |
| getARGB | back to summary |
|---|---|
public abstract byte[] getARGB()
| |
| getARGBHex | back to summary |
|---|---|
public String getARGBHex()
| |
| getIndex | back to summary |
|---|---|
public abstract short getIndex()
| |
| getIndexedRGB | back to summary |
|---|---|
protected abstract byte[] getIndexedRGB()
| |
| getRGB | back to summary |
|---|---|
public abstract byte[] getRGB()
| |
| getRGBOrARGB | back to summary |
|---|---|
protected byte[] getRGBOrARGB()
| |
| getRGBWithTint | back to summary |
|---|---|
public byte[] getRGBWithTint()
| |
| getStoredRGB | back to summary |
|---|---|
protected abstract byte[] getStoredRGB()
| |
| getTheme | back to summary |
|---|---|
public abstract int getTheme()
| |
| getTint | back to summary |
|---|---|
| public abstract double getTint() Specifies the tint value applied to the ctColor. 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
| |
| isAuto | back to summary |
|---|---|
public abstract boolean isAuto()
| |
| isIndexed | back to summary |
|---|---|
public abstract boolean isIndexed()
| |
| isRGB | back to summary |
|---|---|
public abstract boolean isRGB()
| |
| isThemed | back to summary |
|---|---|
public abstract boolean isThemed()
| |
| setARGBHex | back to summary |
|---|---|
| public void setARGBHex(String argb) Sets the ARGB value from hex format, eg FF0077FF. Only works for regular (non-indexed) colours
| |
| setColor | back to summary |
|---|---|
protected void setColor(Color clr)
| |
| setRGB | back to summary |
|---|---|
| public abstract void setRGB(byte[] rgb) Sets the Red Green Blue or Alpha Red Green Blue
| |
| setTint | back to summary |
|---|---|
| public abstract void setTint(double tint) Specifies the tint value applied to the ctColor. 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
| |