Package toxi.color

Examples of toxi.color.ColorList


        float delta = c.distanceToHSV(d);
        assertEquals(0.0f, delta);
    }

    public void testColorList() {
        ColorList list = new ColorList();
        for (int i = 0; i < 10; i++) {
            list.add(TColor.newHSV(MathUtils.random(1f), MathUtils.random(1f),
                    MathUtils.random(1f)));
        }
        AccessCriteria criteria = AccessCriteria.RED;
        ColorList sorted = list.sortByCriteria(criteria, false);
        ReadonlyTColor prev = null;
        for (ReadonlyTColor c : sorted) {
            System.out.println(c);
            if (prev != null) {
                assertTrue(prev.getComponentValue(criteria) <= c
View Full Code Here


            System.out.println(c);
        }
    }

    public void testColorListContains() {
        ColorList list = new ColorList();
        list.add(TColor.RED);
        list.add(TColor.GREEN);
        list.add(TColor.BLUE);
        assertEquals(true, list.contains(TColor.newRGB(0, 0, 1f)));
    }
View Full Code Here

        ColorGradient grad = new ColorGradient();
        grad.addColorAt(0, TColor.RED);
        grad.addColorAt(0.5f, TColor.RED);
        grad.addColorAt(2.5f, TColor.YELLOW);
        grad.addColorAt(299f, TColor.BLUE);
        ColorList cols = grad.calcGradient();
        // assertEquals(TColor.BLUE, cols.get(-1));
    }
View Full Code Here

    public void testThemes() {
        ColorTheme t = new ColorTheme("test");
        t.addRange("dark blue", 0.5f);
        t.addRange("soft orange", 0.5f);
        ColorList cols = t.getColors(1000);
        for (ReadonlyTColor c : cols) {
            assertNotNull(c);
        }
    }
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.