get Randomized Maximum Contrast Color List - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

get Randomized Maximum Contrast Color List

Demo Code


import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main{
    public static void main(String[] argv) throws Exception{
        System.out.println(getRandomizedMaximumContrastList());
    }//from w  w w . j  a v  a2  s . co m
    private static final Colour[] KELLY_LIST_MAXIMUM_CONTRAST = new Colour[] {
            new Colour(0xFFB300), //Vivid Yellow
            new Colour(0x803E75), //Strong Purple
            new Colour(0xFF6800), //Vivid Orange
            new Colour(0xA6BDD7), //Very Light Blue
            new Colour(0xC10020), //Vivid Red
            new Colour(0xCEA262), //Grayish Yellow
            new Colour(0x817066), //Medium Gray

            //The following will not be good for people with defective color vision
            new Colour(0x007D34), //Vivid Green
            new Colour(0xF6768E), //Strong Purplish Pink
            new Colour(0x00538A), //Strong Blue
            new Colour(0xFF7A5C), //Strong Yellowish Pink
            new Colour(0x53377A), //Strong Violet
            new Colour(0xFF8E00), //Vivid Orange Yellow
            new Colour(0xB32851), //Strong Purplish Red
            new Colour(0xF4C800), //Vivid Greenish Yellow
            new Colour(0x7F180D), //Strong Reddish Brown
            new Colour(0x93AA00), //Vivid Yellowish Green
            new Colour(0x593315), //Deep Yellowish Brown
            new Colour(0xF13A13), //Vivid Reddish Orange
            new Colour(0x232C16) };
    public static List<Colour> getRandomizedMaximumContrastList() {
        List<Colour> cols = new ArrayList<Colour>();

        for (Colour c : KELLY_LIST_MAXIMUM_CONTRAST)
            cols.add(c);

        Collections.shuffle(cols);
        return cols;
    }
}

Related Tutorials