Examples of CTHslColor


Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTHslColor

        assertEquals(50, color.getTint());
    }

    public void testHSL() {
        CTColor xml = CTColor.Factory.newInstance();
        CTHslColor c = xml.addNewHslClr();
        c.setHue2(14400000);
        c.setSat2(100000);
        c.setLum2(50000);

        XSLFColor color = new XSLFColor(xml, null, null);
        assertEquals(new Color(128, 00, 00), color.getColor());
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTHslColor

    Color toColor(XmlObject obj, XSLFTheme theme) {
        Color color = null;
        for (XmlObject ch : obj.selectPath("*")) {
            if (ch instanceof CTHslColor) {
                CTHslColor hsl = (CTHslColor)ch;
                int h = hsl.getHue2();
                int s = hsl.getSat2();
                int l = hsl.getLum2();
                // This conversion is not correct and differs from PowerPoint.
                // TODO: Revisit and improve.
                color = Color.getHSBColor(h / 60000f, s / 100000f, l / 100000f);
            } else if (ch instanceof CTPresetColor) {
                CTPresetColor prst = (CTPresetColor)ch;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.