use of org.openxmlformats.schemas.drawingml.x2006.main.CTColor in project poi by apache.
the class XSSFFont method setColor.
/**
* set the color for the font in Standard Alpha Red Green Blue color value
*
* @param color - color to use
*/
public void setColor(XSSFColor color) {
if (color == null)
_ctFont.setColorArray(null);
else {
CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
if (ctColor.isSetIndexed()) {
ctColor.unsetIndexed();
}
ctColor.setRgb(color.getRGB());
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTColor in project poi by apache.
the class XSSFPatternFormatting method setFillBackgroundColor.
public void setFillBackgroundColor(short bg) {
CTColor bgColor = CTColor.Factory.newInstance();
bgColor.setIndexed(bg);
setFillBackgroundColor(bgColor);
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTColor in project poi by apache.
the class XSSFPatternFormatting method setFillForegroundColor.
public void setFillForegroundColor(short fg) {
CTColor fgColor = CTColor.Factory.newInstance();
fgColor.setIndexed(fg);
setFillForegroundColor(fgColor);
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTColor in project poi by apache.
the class XSSFFontFormatting method getFontColorIndex.
/**
* @return font color index
*/
@Override
public short getFontColorIndex() {
if (_font.sizeOfColorArray() == 0)
return -1;
int idx = 0;
CTColor color = _font.getColorArray(0);
if (color.isSetIndexed())
idx = (int) color.getIndexed();
return (short) idx;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTColor in project poi by apache.
the class XWPFRun method getColor.
/**
* Get text color. The returned value is a string in the hex form "RRGGBB".
*/
public String getColor() {
String color = null;
if (run.isSetRPr()) {
CTRPr pr = run.getRPr();
if (pr.isSetColor()) {
CTColor clr = pr.getColor();
color = clr.xgetVal().getStringValue();
}
}
return color;
}
Aggregations