Package com.emitrom.lienzo.shared.core.types

Examples of com.emitrom.lienzo.shared.core.types.Color


        context.fillRect(0, 0, 2, 2);

        ImageData data = context.getImageData(0, 0, 2, 2);

        return new Color(data.getRedAt(1, 1), data.getGreenAt(1, 1), data.getBlueAt(1, 1), (((double) data.getAlphaAt(1, 1)) / 255.0));
    }
View Full Code Here


                // Now draw the image again, replacing each color with the color key

                scratch.clear();

                Color rgb = Color.fromColorString(m_picture.getColorKey());

                context.putImageData(new RGBIgnoreAlphaImageDataFilter(rgb.getR(), rgb.getG(), rgb.getB()).filter(imageData, true), 0, 0);

                // Load the resulting image from the temporary canvas into the selection Image

                String dataURL = scratch.toDataURL();
View Full Code Here

            @Override
            public boolean init(Node<?> node)
            {
                if ((node != null) && (m_attribute != null) && (node.getAttributeSheet().contains(m_attribute)))
                {
                    Color cend = ColorExtractor.extract(m_target);

                    String color = getColorString(node);

                    if ((null == color) || ((color = color.trim()).isEmpty()))
                    {
                        color = "transparent";
                    }
                    Color cbeg;

                    if ("transparent".equals(color))
                    {
                        cbeg = new Color(cend.getR(), cend.getG(), cend.getB(), 0.0);
                    }
                    else
                    {
                        cbeg = ColorExtractor.extract(color);
                    }
                    m_origin_r = cbeg.getR();

                    m_origin_g = cbeg.getG();

                    m_origin_b = cbeg.getB();

                    m_origin_a = cbeg.getA();

                    m_target_r = cend.getR();

                    m_target_g = cend.getG();
View Full Code Here

                double b = (m_origin_b + ((m_target_b - m_origin_b) * percent));

                double a = (m_origin_a + ((m_target_a - m_origin_a) * percent));

                setColorString(node, new Color(((int) (r + 0.5)), ((int) (g + 0.5)), ((int) (b + 0.5)), a).getColorString());

                return true;
            }
View Full Code Here

                // Now draw the image again, replacing each color with the color key

                scratch.clear();

                Color rgb = Color.fromColorString(m_picture.getColorKey());

                context.putImageData(new RGBIgnoreAlphaImageDataFilter(rgb.getR(), rgb.getG(), rgb.getB()).filter(imageData), 0, 0);

                // Load the resulting image from the temporary canvas into the selection Image

                String dataURL = scratch.toDataURL();
View Full Code Here

        redraw();
    }

    protected void setDefaultRectangle()
    {
        setRectangle(new Rectangle(1, 1).setStrokeColor(new Color(0, 0, 0, 0.5)));
    }
View Full Code Here

TOP

Related Classes of com.emitrom.lienzo.shared.core.types.Color

Copyright © 2018 www.massapicom. 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.