I am trying to write a huge excel file, my requirement allows me to write the row and forget, so i am using SXSSF which allows to keep only a few number of rows in memory an
CellStyle style = workbook.createCellStyle(); // workbook is of SXSSF type
byte orange[] = new byte[] { (byte) 248, (byte) 203, (byte) 173 };
byte thick_shade_blue[] = new byte[] { (byte) 142, (byte) 169, (byte) 219 };
byte blue[] = new byte[] { (byte) 180, (byte) 198, (byte) 231 };
((XSSFCellStyle) style).setFillForegroundColor(new XSSFColor(thick_shade_blue, null));
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);