I have an XSSF book, and I want to define my own background color in a set of cells with certain conditional formatting, but the problem is that the method setFillBackgroundColor()in the class PatternFormattingtakes only a short type argument, and not XSSFColoras follows:
PatternFormatting fill = rule1.createPatternFormatting();
fill.setFillBackgroundColor(new XSSFColor(new java.awt.Color(80, 80, 100));
fill.setFillPattern(PatternFormatting.SOLID_FOREGROUND);
I can do it fill.setFillBackgroundColor(IndexedColors.RED.index), but I want to define my own color. How can i do this?
source
share