Package booton.css.value

Examples of booton.css.value.Color


     *
     * @param transparency A transparency of shadow.
     * @return
     */
    public Text shadow(double transparency) {
        Color color = new Color(0, 0, css.font.color().lightness < 50 ? 100 : 0, transparency);
        shadow(1, px, 0, px, 0, px, color);
        shadow(0, px, 1, px, 0, px, color);

        return this;
    }
View Full Code Here


     *
     * @param transparency A transparency of shadow.
     * @return
     */
    public Text outline(double transparency) {
        Color color = new Color(0, 0, css.font.color().lightness < 50 ? 100 : 0, transparency);
        shadow(1, px, 0, px, 0, px, color);
        shadow(0, px, 1, px, 0, px, color);
        shadow(-1, px, 0, px, 0, px, color);
        shadow(0, px, -1, px, 0, px, color);

View Full Code Here

     *
     * @param transparency A transparency of shadow.
     * @return
     */
    public Text shadow(double transparency) {
        Color color = new Color(0, 0, css.font.color().lightness < 50 ? 100 : 0, transparency);
        shadow(1, px, 0, px, 0, px, color);
        shadow(0, px, 1, px, 0, px, color);

        return this;
    }
View Full Code Here

     *
     * @param transparency A transparency of shadow.
     * @return
     */
    public Text outline(double transparency) {
        Color color = new Color(0, 0, css.font.color().lightness < 50 ? 100 : 0, transparency);
        shadow(1, px, 0, px, 0, px, color);
        shadow(0, px, 1, px, 0, px, color);
        shadow(-1, px, 0, px, 0, px, color);
        shadow(0, px, -1, px, 0, px, color);

View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public Color color() {
        Color backgroundColor = color;

        if (backgroundColor == null) {
            for (Object image : images) {
                if (image instanceof LinearGradient) {
                    backgroundColor = ((LinearGradient) image).getEndColor();
View Full Code Here

    @Override
    protected void write(StyleDeclarable writer) {
        if (match(widths) && match(styles) && match(colors)) {
            Numeric width = widths.get(Side.Top);
            BorderStyle style = styles.get(Side.Top);
            Color color = colors.get(Side.Top);

            if (width != null && style != null && color != null) {
                writer.property(name, width, style, color);
            } else {
                writer.property(name + "-width", width);
View Full Code Here

     * @return A result.
     */
    private boolean match(Side side) {
        Numeric width = widths.get(side);
        BorderStyle style = styles.get(side);
        Color color = colors.get(side);

        return (width == null && style == null && color == null) || (width != null && style != null && color != null);
    }
View Full Code Here

     * @param lightness The brightness relative to the brightness of a similarly illuminated white.
     * @param alpha The transparency.
     * @return A new color.
     */
    public static final Color hsla(int hue, int saturation, int lightness, double alpha) {
        return new Color(hue, saturation, lightness, alpha);
    }
View Full Code Here

     * @param bubbleHeight
     */
    public final void createBottomBubble(int bubbleHeight) {

        Numeric borderWidth = border.width();
        Color borderColor = border.color();
        Color boxBackColor = background.color();

        if (!position.isAbsolute() && !position.isRelative()) {
            position.relative();
        }

        Numeric width = borderWidth.add(bubbleHeight);

        // write bubble border color
        before(() -> {
            display.block();
            box.size(0, px);
            content.text("");
            position.absolute().left(50, percent).top(100, percent);
            margin.left(width.opposite());
            border.solid().color(Transparent).width(width);
            border.top.color(borderColor);
        });

        // write bubble background color
        if (borderWidth.size != 0) {
            Numeric width2 = width.subtract(borderWidth.multiply(1.5));

            after(() -> {
                display.block();
                box.size(0, px);
                content.text("");
                position.absolute().left(50, percent).top(100, percent);
                margin.left(width2.opposite());
                border.solid().color(Transparent).width(width2);
                border.top.color(boxBackColor.opacify(1));
            });
        }
    }
View Full Code Here

     *
     * @param bubbleHeight
     */
    public final void createTopBubble(int bubbleHeight) {
        Numeric borderWidth = border.width();
        Color borderColor = border.color();
        Color boxBackColor = background.color();

        if (!position.isAbsolute() && !position.isRelative()) {
            position.relative();
        }

        Numeric width = borderWidth.add(bubbleHeight);

        // write bubble border color
        before(() -> {
            display.block();
            box.size(0, px);
            content.text("");
            position.absolute().left(50, percent).bottom(100, percent);
            margin.left(width.opposite());
            border.solid().color(Transparent).width(width);
            border.bottom.color(borderColor);
        });

        // write bubble background color
        if (borderWidth.size != 0) {
            Numeric borderWitdh = width.subtract(borderWidth.multiply(1.5));

            after(() -> {
                display.block();
                box.size(0, px);
                content.text("");
                position.absolute().left(50, percent).bottom(100, percent);
                margin.left(borderWitdh.opposite());
                border.solid().color(Transparent).width(borderWitdh);
                border.bottom.color(boxBackColor.opacify(1));
            });
        }
    }
View Full Code Here

TOP

Related Classes of booton.css.value.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.