org.apache.poi.ss.usermodel
Class ExtendedColor

java.lang.Object  extended by org.apache.poi.ss.usermodel.ExtendedColor
All Implemented Interfaces:
Color
Direct Known Subclasses:
HSSFExtendedColor

public abstract class ExtendedColor
extends java.lang.Object
implements Color

Represents a XSSF-style color (based on either a XSSFColor or a ExtendedColor


Constructor Summary
ExtendedColor()
           
 
Method Summary
abstract  byte[]getARGB()
          Standard Alpha Red Green Blue ctColor value (ARGB).
 java.lang.StringgetARGBHex()
          Return the ARGB value in hex format, eg FF00FF00.
abstract  shortgetIndex()
          Indexed Color value, if isIndexed() is true
abstract  byte[]getRGB()
          Standard Red Green Blue ctColor value (RGB).
protected  byte[]getRGBOrARGB()
           
 byte[]getRGBWithTint()
          Standard Red Green Blue ctColor value (RGB) with applied tint.
protected abstract  byte[]getStoredRBG()
          RGB or ARGB or null
abstract  intgetTheme()
          Index of Theme color, if isThemed() is true
abstract  doublegetTint()
          Specifies the tint value applied to the ctColor.
abstract  booleanisAuto()
          A boolean value indicating the color is automatic
abstract  booleanisIndexed()
          A boolean value indicating the color is indexed
abstract  booleanisRGB()
          A boolean value indicating the color is RGB / ARGB
abstract  booleanisThemed()
          A boolean value indicating the color is from a Theme
 voidsetARGBHex(java.lang.String argb)
          Sets the ARGB value from hex format, eg FF0077FF.
protected  voidsetColor(java.awt.Color clr)
           
abstract  voidsetRGB(byte[] rgb)
          Sets the Red Green Blue or Alpha Red Green Blue
abstract  voidsetTint(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

ExtendedColor

public ExtendedColor()
Method Detail

setColor

protected void setColor(java.awt.Color clr)

isAuto

public abstract boolean isAuto()
A boolean value indicating the color is automatic


isIndexed

public abstract boolean isIndexed()
A boolean value indicating the color is indexed


isRGB

public abstract boolean isRGB()
A boolean value indicating the color is RGB / ARGB


isThemed

public abstract boolean isThemed()
A boolean value indicating the color is from a Theme


getIndex

public abstract short getIndex()
Indexed Color value, if isIndexed() is true


getTheme

public abstract int getTheme()
Index of Theme color, if isThemed() is true


getRGB

public abstract byte[] getRGB()
Standard Red Green Blue ctColor value (RGB). If there was an A (Alpha) value, it will be stripped.


getARGB

public abstract byte[] getARGB()
Standard Alpha Red Green Blue ctColor value (ARGB).


getStoredRBG

protected abstract byte[] getStoredRBG()
RGB or ARGB or null


setRGB

public abstract void setRGB(byte[] rgb)
Sets the Red Green Blue or Alpha Red Green Blue


getRGBOrARGB

protected byte[] getRGBOrARGB()

getRGBWithTint

public byte[] getRGBWithTint()
Standard Red Green Blue ctColor value (RGB) with applied tint. Alpha values are ignored.


getARGBHex

public java.lang.String getARGBHex()
Return the ARGB value in hex format, eg FF00FF00. Works for both regular and indexed colours.


setARGBHex

public void setARGBHex(java.lang.String argb)
Sets the ARGB value from hex format, eg FF0077FF. Only works for regular (non-indexed) colours


getTint

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 

Returns:
the tint value

setTint

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 

Parameters:
tint - the tint value




NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14