How can we add custom colors (HEX or RGB) to a SXSSFWorkbook? I found multiple implementations where everyone used HSSFPalette to change the custom palette of a HSSFWorkbook. But unlike HSSFWorkbook, SXSSFWorkbook doesn't have a getCustomPalette call and therefore I couldn't get any palette to override. Any pointers?
An SXSSFWorkbook
is a wrapper around a XSSFWorkbook
. Because it's just XSSF
, you can directly create an XSSFColor
with any RGB you want. You don't need to override any palette.
XSSFColor customColor = new XSSFColor(new byte[] {alpha, red, green, blue});
You can also pass a java.awt.Color
if you want.
XSSFColor anotherColor = new XSSFColor(new java.awt.Color(red, green, blue, alpha));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With