private void initialize(){ CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. _schemeColors = new HashMap<>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); _schemeColors.put(name, c); } }
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor; switch (ThemeElement.byId(idx)) {
private void initialize(){ CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. _schemeColors = new HashMap<>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); _schemeColors.put(name, c); } }
private void initialize(){ CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. _schemeColors = new HashMap<String, CTColor>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); _schemeColors.put(name, c); } }
public XSSFColor getThemeColor(int idx) { CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor = null; int cnt = 0; for (XmlObject obj : colorScheme.selectPath("./*")) { if (obj instanceof org.openxmlformats.schemas.drawingml.x2006.main.CTColor) { if (cnt == idx) { ctColor = (org.openxmlformats.schemas.drawingml.x2006.main.CTColor) obj; byte[] rgb = null; if (ctColor.getSrgbClr() != null) { // Colour is a regular one rgb = ctColor.getSrgbClr().getVal(); } else if (ctColor.getSysClr() != null) { // Colour is a tint of white or black rgb = ctColor.getSysClr().getLastClr(); } return new XSSFColor(rgb); } cnt++; } } return null; }
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor; switch (ThemeElement.byId(idx)) {