make a series of random colors – no 2 similar colors in a row

brightness — Colors should not be too light to read on a white background.

saturation — push to the max

private Color makeColor() {
float piePieces = 50;//how many pizza slices in a pie
for (;;) {
int tmpHue = this.rand.nextInt((int) piePieces + 1);
if (Math.abs(tmpHue - this.intHue) / piePieces > 0.11) {
// 0.5 means exact opposite color
this.intHue = tmpHue;
float hue = tmpHue / piePieces; // 0 to 1
return Color.getHSBColor(hue, 0.99999f, 0.77f);
}
}
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s