Class HSSFColor

java.lang.Object
loci.poi.hssf.util.HSSFColor
Direct Known Subclasses:
HSSFColor.AQUA, HSSFColor.AUTOMATIC, HSSFColor.BLACK, HSSFColor.BLUE, HSSFColor.BLUE_GREY, HSSFColor.BRIGHT_GREEN, HSSFColor.BROWN, HSSFColor.CORAL, HSSFColor.CORNFLOWER_BLUE, HSSFColor.DARK_BLUE, HSSFColor.DARK_GREEN, HSSFColor.DARK_RED, HSSFColor.DARK_TEAL, HSSFColor.DARK_YELLOW, HSSFColor.GOLD, HSSFColor.GREEN, HSSFColor.GREY_25_PERCENT, HSSFColor.GREY_40_PERCENT, HSSFColor.GREY_50_PERCENT, HSSFColor.GREY_80_PERCENT, HSSFColor.INDIGO, HSSFColor.LAVENDER, HSSFColor.LEMON_CHIFFON, HSSFColor.LIGHT_BLUE, HSSFColor.LIGHT_CORNFLOWER_BLUE, HSSFColor.LIGHT_GREEN, HSSFColor.LIGHT_ORANGE, HSSFColor.LIGHT_TURQUOISE, HSSFColor.LIGHT_YELLOW, HSSFColor.LIME, HSSFColor.MAROON, HSSFColor.OLIVE_GREEN, HSSFColor.ORANGE, HSSFColor.ORCHID, HSSFColor.PALE_BLUE, HSSFColor.PINK, HSSFColor.PLUM, HSSFColor.RED, HSSFColor.ROSE, HSSFColor.ROYAL_BLUE, HSSFColor.SEA_GREEN, HSSFColor.SKY_BLUE, HSSFColor.TAN, HSSFColor.TEAL, HSSFColor.TURQUOISE, HSSFColor.VIOLET, HSSFColor.WHITE, HSSFColor.YELLOW

public class HSSFColor extends Object
Intends to provide support for the very evil index to triplet issue and will likely replace the color contants interface for HSSF 2.0. This class contains static inner class members for representing colors. Each color has an index (for the standard palette in Excel (tm) ), native (RGB) triplet and string triplet. The string triplet is as the color would be represented by Gnumeric. Having (string) this here is a bit of a collusion of function between HSSF and the HSSFSerializer but I think its a reasonable one in this case.
Author:
Andrew C. Oliver (acoliver at apache dot org), Brian Sanders (bsanders at risklabs dot com) - full default color palette
  • Constructor Details

    • HSSFColor

      public HSSFColor()
      Creates a new instance of HSSFColor
  • Method Details

    • getIndexHash

      public static final Hashtable getIndexHash()
      this function returns all colors in a hastable. Its not implemented as a static member/staticly initialized because that would be dirty in a server environment as it is intended. This means you'll eat the time it takes to create it once per request but you will not hold onto it if you have none of those requests.
      Returns:
      a hashtable containing all colors mapped to their excel-style pallette index
    • getTripletHash

      public static final Hashtable getTripletHash()
      this function returns all colors in a hastable. Its not implemented as a static member/staticly initialized because that would be dirty in a server environment as it is intended. This means you'll eat the time it takes to create it once per request but you will not hold onto it if you have none of those requests.
      Returns:
      a hashtable containing all colors mapped to their gnumeric-like triplet string
    • getIndex

      public short getIndex()
      Returns:
      index to the standard palette
    • getTriplet

      public short[] getTriplet()
      Returns:
      triplet representation like that in Excel
    • getHexString

      public String getHexString()
      Returns:
      a hex string exactly like a gnumeric triplet