* Column C = Explicit Colour Foreground\r
* Column E = Explicit Colour Background, Black Foreground\r
* Column G = Conditional Formatting Backgrounds\r
+ * \r
+ * Note - Grey Row has an odd way of doing the styling... \r
*/\r
@Test\r
public void themedAndNonThemedColours() {\r
XSSFCell cell;\r
\r
String[] names = {"White","Black","Grey","Dark Blue","Blue","Red","Green"};\r
+ String[] explicitFHexes = { "FFFFFFFF", "FF000000", "FFC0C0C0", "FF002060",\r
+ "FF0070C0", "FFFF0000", "FF00B050" };\r
+ String[] explicitBHexes = { "FFFFFFFF", "FF000000", "FFC0C0C0", "FF002060",\r
+ "FF0000FF", "FFFF0000", "FF00FF00" };\r
assertEquals(7, names.length);\r
\r
// Check the non-CF colours in Columns A, B, C and E\r
assertCellContents(names[idx], row.getCell(2));\r
assertCellContents(names[idx], row.getCell(4));\r
\r
+ \r
// Check the colours\r
+ \r
// A: Theme Based, Foreground\r
style = themeCell.getCellStyle();\r
color = style.getFont().getXSSFColor();\r
assertEquals(true, color.isThemed());\r
assertEquals(idx, color.getTheme());\r
assertEquals(rgbExpected[idx], Hex.encodeHexString(color.getRGB()));\r
+ \r
// B: Theme Based, Foreground\r
cell = row.getCell(1);\r
style = cell.getCellStyle();\r
color = style.getFont().getXSSFColor();\r
assertEquals(true, color.isThemed());\r
- // TODO Fix the grey theme color in Column B\r
if (idx != 2) {\r
assertEquals(idx, color.getTheme());\r
assertEquals(rgbExpected[idx], Hex.encodeHexString(color.getRGB()));\r
+ } else {\r
+ assertEquals(1, color.getTheme());\r
+ assertEquals(0.50, color.getTint(), 0.001);\r
}\r
+ \r
+ // C: Explicit, Foreground\r
+ cell = row.getCell(2);\r
+ style = cell.getCellStyle();\r
+ color = style.getFont().getXSSFColor();\r
+ assertEquals(false, color.isThemed());\r
+ assertEquals(explicitFHexes[idx], color.getARGBHex());\r
+ \r
+ // E: Explicit Background, Foreground all Black\r
+ cell = row.getCell(4);\r
+ style = cell.getCellStyle();\r
+ \r
+ color = style.getFont().getXSSFColor();\r
+ assertEquals(true, color.isThemed());\r
+ assertEquals("FF000000", color.getARGBHex());\r
+ \r
+ color = style.getFillForegroundXSSFColor();\r
+ assertEquals(false, color.isThemed());\r
+ assertEquals(explicitBHexes[idx], color.getARGBHex());\r
+ color = style.getFillBackgroundColorColor();\r
+ assertEquals(false, color.isThemed());\r
+ assertEquals(null, color.getARGBHex());\r
}\r
\r
// Check the CF colours\r