I have a XSSF workbook and I want to define a custom background color in a set of cells with a conditional formatting defined, but the problem is that the setFillBackgroundColor()
method in the PatternFormatting
class only accepts a type short argument, not a XSSFColor
like this:
PatternFormatting fill = rule1.createPatternFormatting();
fill.setFillBackgroundColor(new XSSFColor(new java.awt.Color(80, 80, 100));
fill.setFillPattern(PatternFormatting.SOLID_FOREGROUND);
I can do fill.setFillBackgroundColor(IndexedColors.RED.index)
, but I want to define a custom color. How can i do this?.