我想写一个输出Excel工作表中单元格颜色的代码,但是当调用GetFillBackgroundColor方法时,它给了我三个负值。我想知道,有没有关于RGB数字? 这是我写的代码:Apache POI - 负值颜色值
CellStyle style = currentCell2.getCellStyle();
Color color = style.getFillBackgroundColorColor();
if (color != null) {
byte[] clr = ((XSSFColor) color).getRGB();
System.out.print("(");
for (int k = 0; k<clr.length; k++) {
System.out.print(clr[k]+" ");
}
System.out.print(")");
}
你能给我们用来测试它的颜色吗? – XtremeBaumer
我添加了我正在使用的excel文件的图片。 –