]> source.dussan.org Git - poi.git/commitdiff
Add a method to HSSFFont to get the color, similar to the XSSF one
authorNick Burch <nick@apache.org>
Thu, 29 Sep 2011 19:40:47 +0000 (19:40 +0000)
committerNick Burch <nick@apache.org>
Thu, 29 Sep 2011 19:40:47 +0000 (19:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1177410 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFFont.java

index 4e2a2fe8987e142d81256b489bd4e14ec4be6204..61d89dbc75ec29bdc7bc00596fd3dd25170a9033 100644 (file)
@@ -18,6 +18,7 @@
 package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.record.FontRecord;
+import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.Font;
 
 /**
@@ -191,6 +192,15 @@ public final class HSSFFont implements Font {
     {
         return font.getColorPaletteIndex();
     }
+    
+    /**
+     * get the color value for the font
+     */
+    public HSSFColor getHSSFColor(HSSFWorkbook wb)
+    {
+       HSSFPalette pallette = wb.getCustomPalette();
+       return pallette.getColor( getColor() );
+    }
 
     /**
      * set the boldness to use