2014-02-07 38 views

回答

6

XSSFCellStyle可以getXSSFFont。從那裏,你可以getXSSFColor。最後,從XSSFColor,你可以得到的顏色信息ARGB HexRGB with Tint

您的代碼看起來是這樣的:

XSSFCellStyle style = cell.getCellStyle(); 
XSSFFont font = style.getFont(); 
XSSFColor colour = font.getXSSFColour(); 
System.out.println("The colour is " + colour.getARGBHex()); 
+0

我得到空回色當我打電話font.getXSSFColour( )。我可以調用getColor()並獲得一個調色板索引號(如果這個值很大,則爲8)。單元格沒有空字符串內容。任何想法如何從貨盤索引中獲得rgb? –