You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by WG...@ryko.COM on 2003/04/25 00:30:51 UTC

palette.getColor() isn't working

If this is the way that you get a color from a workbook into a 
java.awt.Color object, it isn't working.  HSSFColor always comes up null. 
What am I doing wrong!?

HSSFPalette palette = hssfWorkbook.getCustomPalette();
HSSFColor color = 
palette.getColor(cell.getCellStyle().getFillForegroundColor());
short triplet[] = color.getTriplet();
 
new Color(triplet[0], triplet[1], triplet[2])