Я использую apache poi 3.9 в моем проекте, мне нужно получить цвет фона ячейки файла XSSF.
Workbook myWorkBook = WorkbookFactory.create(new File(filePath));
Sheet mySheet = myWorkBook.getSheetAt(0);
Row currentRow = null;
Iterator<Row> rowIterator = mySheet.iterator();
while (rowIterator.hasNext())
{
currentRow = (Row) rowIterator.next();
totalColumns = currentRow.getPhysicalNumberOfCells();
for (int column = 0; column < totalColumns; column++)
{
Cell cell = currentRow.getCell(column);
CellStyle cellStyle = cell.getCellStyle();
short colorIdx=cellStyle.getFillForegroundColor();
// I am struct in this step to get XSSF cell background color
}
}