Package toxi.color

Examples of toxi.color.ColorList


     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList colors = new ColorList(src);
        colors.add(src.getRotatedRYB(150).lighten(0.1f));
        colors.add(src.getRotatedRYB(210).lighten(0.1f));
        return colors;
    }
View Full Code Here


     */
    public static final String NAME = "leftSplitComplementary";

    public ColorList createListFromColor(ReadonlyTColor src) {
        ReadonlyTColor left = src.getComplement().rotateRYB(-30).lighten(0.1f);
        ColorList colors = ColorTheoryRegistry.COMPLEMENTARY
                .createListFromColor(src);
        for (int i = 3; i < 6; i++) {
            TColor c = colors.get(i);
            c.setHue(left.hue());
        }
        return colors;
    }
View Full Code Here

     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        contrast = MathUtils.clipNormalized(contrast);
        ColorList colors = new ColorList(src);
        for (Vec2D currTone : tones) {
            TColor c = src.getRotatedRYB(theta * currTone.x);
            float t = 0.44f - currTone.y * 0.1f;
            if (src.brightness() - contrast * currTone.y < t) {
                c.setBrightness(t);
            } else {
                c.setBrightness(src.brightness() - contrast * currTone.y);
            }
            c.desaturate(0.05f);
            colors.add(c);
        }
        return colors;
    }
View Full Code Here

     */
    public static final String NAME = "rightSplitComplementary";

    public ColorList createListFromColor(ReadonlyTColor src) {
        ReadonlyTColor left = src.getComplement().rotateRYB(30).lighten(0.1f);
        ColorList colors = ColorTheoryRegistry.COMPLEMENTARY
                .createListFromColor(src);
        for (int i = 3; i < 6; i++) {
            TColor c = colors.get(i);
            c.setHue(left.hue());
        }
        return colors;
    }
View Full Code Here

     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList colors = new ColorList(src);
        TColor c = src.getRotatedRYB(theta);
        if (c.brightness() < 0.5) {
            c.lighten(0.2f);
        } else {
            c.darken(0.2f);
        }
        colors.add(c);

        c = src.getRotatedRYB(theta * 2);
        if (c.brightness() < 0.5) {
            c.lighten(0.1f);
        } else {
            c.darken(0.1f);
        }
        colors.add(c);

        colors.add(src.getRotatedRYB(theta * 3).lighten(0.1f));
        return colors;
    }
View Full Code Here

     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList colors = new ColorList(src);
        int direction = isFlipped ? -1 : 1;

        TColor c = src.getRotatedRYB(30 * direction);
        c.setBrightness(wrap(c.brightness(), 0.25f, 0.6f, 0.25f));
        colors.add(c);

        c = src.getRotatedRYB(30 * direction);
        c.setSaturation(wrap(c.saturation(), 0.4f, 0.1f, 0.4f));
        c.setBrightness(wrap(c.brightness(), 0.4f, 0.2f, 0.4f));
        colors.add(c);

        c = src.getRotatedRYB(160 * direction);
        c.setSaturation(wrap(c.saturation(), 0.25f, 0.1f, 0.25f));
        c.setBrightness(MathUtils.max(0.2f, c.brightness()));
        colors.add(c);

        c = src.getRotatedRYB(150 * direction);
        c.setSaturation(wrap(c.saturation(), 0.1f, 0.8f, 0.1f));
        c.setBrightness(wrap(c.brightness(), 0.3f, 0.6f, 0.3f));
        colors.add(c);

        c = src.getRotatedRYB(150 * direction);
        c.setSaturation(wrap(c.saturation(), 0.1f, 0.8f, 0.1f));
        c.setBrightness(wrap(c.brightness(), 0.4f, 0.2f, 0.4f));
        // colors.add(c);
View Full Code Here

     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList colors = new ColorList(src);
        // # A contrasting color: much darker or lighter than the original.
        TColor c = src.copy();
        if (c.brightness() > 0.4) {
            c.setBrightness(0.1f + c.brightness() * 0.25f);
        } else {
            c.setBrightness(1.0f - c.brightness() * 0.25f);
        }
        colors.add(c);

        // A soft supporting color: lighter and less saturated.
        c = src.copy();
        c.lighten(0.3f);
        c.setSaturation(0.1f + c.saturation() * 0.3f);
        colors.add(c);

        // A contrasting complement: very dark or very light.
        c = src.getComplement();
        if (c.brightness() > 0.3) {
            c.setBrightness(0.1f + c.brightness() * 0.25f);
        } else {
            c.setBrightness(1.0f - c.brightness() * 0.25f);
        }
        colors.add(c);

        // The complement and a light supporting variant.
        colors.add(src.getComplement());

        c = src.getComplement();
        c.lighten(0.3f);
        c.setSaturation(0.1f + c.saturation() * 0.25f);
        colors.add(c);
        return colors;
    }
View Full Code Here

     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList colors = new ColorList(src);
        TColor c = src.copy();
        c.setBrightness(wrap(c.brightness(), 0.5f, 0.2f, 0.3f));
        c.setSaturation(wrap(c.saturation(), 0.3f, 0.1f, 0.3f));
        colors.add(c);

        c = src.copy();
        c.setBrightness(wrap(c.brightness(), 0.2f, 0.2f, 0.6f));
        colors.add(c);

        c = src.copy();
        c.setBrightness(MathUtils.max(0.2f,
                c.brightness() + (1 - c.brightness()) * 0.2f));
        c.setSaturation(wrap(c.saturation(), 0.3f, 0.1f, 0.3f));
        colors.add(c);

        c = src.copy();
        c.setBrightness(wrap(c.brightness(), 0.5f, 0.2f, 0.3f));
        colors.add(c);

        return colors;
    }
View Full Code Here

     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList colors = new ColorList(src);
        colors.add(src.getRotatedRYB(120).lighten(0.1f));
        colors.add(src.getRotatedRYB(-120).lighten(0.1f));
        return colors;
    }
View Full Code Here

     *
     * @see
     * toxi.color.ColorTheoryStrategy#createListFromcolor(toxi.color.TColor)
     */
    public ColorList createListFromColor(ReadonlyTColor src) {
        ColorList list = new ColorList(src);
        list.add(src.getComplement());
        return list;
    }
View Full Code Here

TOP

Related Classes of toxi.color.ColorList

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.