/** * If the colour is based on a theme, then inherit * information (currently just colours) from it as * required. */ @Override public void inheritFromThemeAsRequired(XSSFColor color) { if(color == null) { // Nothing for us to do return; } if(! color.getCTColor().isSetTheme()) { // No theme set, nothing to do return; } // Get the theme colour XSSFColor themeColor = getThemeColor(color.getTheme()); // Set the raw colour, not the adjusted one // Do a raw set, no adjusting at the XSSFColor layer either color.getCTColor().setRgb(themeColor.getCTColor().getRgb()); // All done }
public Color getAwtColor(XSSFColor color) { if(color == null){ return Color.BLACK; } if (color.getRgb() != null) { return new Color(ByteBuffer.wrap(color.getRgb()).getInt(), true); } else { if(color.getIndexed() == 64){ return Color.BLACK; } return getAwtColor(color.getTheme(), color.getTint()); } }
/** * If the colour is based on a theme, then inherit * information (currently just colours) from it as * required. */ @Override public void inheritFromThemeAsRequired(XSSFColor color) { if(color == null) { // Nothing for us to do return; } if(! color.getCTColor().isSetTheme()) { // No theme set, nothing to do return; } // Get the theme colour XSSFColor themeColor = getThemeColor(color.getTheme()); // Set the raw colour, not the adjusted one // Do a raw set, no adjusting at the XSSFColor layer either color.getCTColor().setRgb(themeColor.getCTColor().getRgb()); // All done }
/** * If the colour is based on a theme, then inherit * information (currently just colours) from it as * required. */ public void inheritFromThemeAsRequired(XSSFColor color) { if(color == null) { // Nothing for us to do return; } if(! color.getCTColor().isSetTheme()) { // No theme set, nothing to do return; } // Get the theme colour XSSFColor themeColor = getThemeColor(color.getTheme()); // Set the raw colour, not the adjusted one // Do a raw set, no adjusting at the XSSFColor layer either color.getCTColor().setRgb(themeColor.getCTColor().getRgb()); // All done } }