Color shadowColor = DrawPaint.applyColorTransform(shadowPaint.getSolidColor());
@SuppressWarnings({"WeakerAccess", "unused"}) protected Paint getSolidPaint(SolidPaint fill, Graphics2D graphics, final PaintModifier modifier) { final ColorStyle orig = fill.getSolidColor(); ColorStyle cs = new AbstractColorStyle() { @Override
Color shadowColor = DrawPaint.applyColorTransform(shadowPaint.getSolidColor());
/** * Returns the bullet color */ public Color getBulletColor() { TextProp tp = getPropVal(_paragraphStyle, "bullet.color"); boolean hasColor = getFlag(ParagraphFlagsTextProp.BULLET_HARDCOLOR_IDX); if (tp == null || !hasColor) { // if bullet color is undefined, return color of first run if (_runs.isEmpty()) { return null; } SolidPaint sp = _runs.get(0).getFontColor(); if(sp == null) { return null; } return DrawPaint.applyColorTransform(sp.getSolidColor()); } return getColorFromColorIndexStruct(tp.getValue(), _sheet); }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ @SuppressWarnings("WeakerAccess") public void setBulletFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("Currently XSLF only supports SolidPaint"); } // TODO: implement setting bullet color to null SolidPaint sp = (SolidPaint)color; Color col = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) col.getRed(), (byte) col.getGreen(), (byte) col.getBlue()}); }
private ColorStyle wrapColor(Color col) { return (col == null) ? null : DrawPaint.createSolidPaint(col).getSolidColor(); }
/** * * @return solid fill color of null if not set */ @Override public Color getFillColor() { PaintStyle ps = getFillPaint(); if (ps instanceof SolidPaint) { ColorStyle cs = ((SolidPaint) ps).getSolidColor(); return DrawPaint.applyColorTransform(cs); } return null; }
@Override public void setFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { LOG.log(POILogger.WARN, "Currently only SolidPaint is supported!"); return; } SolidPaint sp = (SolidPaint)color; Color c = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextCharacterProperties rPr = getRPr(true); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getParentParagraph().getParentShape().getSheet().getTheme(), fill.getSchemeClr()); col.setColor(c); }
@Override public Color getFillColor() { PaintStyle ps = getFillPaint(); if (ps instanceof SolidPaint) { return DrawPaint.applyColorTransform(((SolidPaint)ps).getSolidColor()); } return null; }
/** * @return the color of this shadow. * Depending whether the parent shape is filled or stroked, this color is used to fill or stroke this shadow */ public Color getFillColor() { SolidPaint ps = getFillStyle(); if (ps == null) return null; return DrawPaint.applyColorTransform(ps.getSolidColor()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SolidPaint)) { return false; } return Objects.equals(getSolidColor(), ((SolidPaint) o).getSolidColor()); }
/** * * @return the color of the shape outline or <code>null</code> * if outline is turned off */ @SuppressWarnings("WeakerAccess") public Color getLineColor() { PaintStyle ps = getLinePaint(); if (ps instanceof SolidPaint) { return ((SolidPaint)ps).getSolidColor().getColor(); } return null; }
@Override public void setBulletFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("HSLF only supports SolidPaint"); } SolidPaint sp = (SolidPaint)color; Color col = DrawPaint.applyColorTransform(sp.getSolidColor()); HSLFTextParagraph.this.setBulletColor(col); }
@Override public void setFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("HSLF only supports solid paint"); } // In PowerPont RGB bytes are swapped, as BGR SolidPaint sp = (SolidPaint)color; Color c = DrawPaint.applyColorTransform(sp.getSolidColor()); int rgb = new Color(c.getBlue(), c.getGreen(), c.getRed(), 254).getRGB(); setFontColor(rgb); }
@SuppressWarnings({"WeakerAccess", "unused"}) protected Paint getSolidPaint(SolidPaint fill, Graphics2D graphics, final PaintModifier modifier) { final ColorStyle orig = fill.getSolidColor(); ColorStyle cs = new AbstractColorStyle() { @Override
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ @SuppressWarnings("WeakerAccess") public void setBulletFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("Currently XSLF only supports SolidPaint"); } // TODO: implement setting bullet color to null SolidPaint sp = (SolidPaint)color; Color col = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) col.getRed(), (byte) col.getGreen(), (byte) col.getBlue()}); }
/** * * @return the color of the shape outline or <code>null</code> * if outline is turned off */ @SuppressWarnings("WeakerAccess") public Color getLineColor() { PaintStyle ps = getLinePaint(); if (ps instanceof SolidPaint) { return ((SolidPaint)ps).getSolidColor().getColor(); } return null; }
@Override public void setFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { LOG.log(POILogger.WARN, "Currently only SolidPaint is supported!"); return; } SolidPaint sp = (SolidPaint)color; Color c = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextCharacterProperties rPr = getRPr(true); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getParentParagraph().getParentShape().getSheet().getTheme(), fill.getSchemeClr()); col.setColor(c); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SolidPaint)) { return false; } return Objects.equals(getSolidColor(), ((SolidPaint) o).getSolidColor()); }
/** * * @return solid fill color of null if not set */ @Override public Color getFillColor() { PaintStyle ps = getFillPaint(); if (ps instanceof SolidPaint) { ColorStyle cs = ((SolidPaint) ps).getSolidColor(); return DrawPaint.applyColorTransform(cs); } return null; }