Here you can find the source of getRandomColour()
public static Color getRandomColour()
//package com.java2s; //License from project: LGPL import java.awt.Color; import java.util.Random; public class Main { private static Random generator = null; /**// ww w . j ava 2 s. c om * Get a random colour from a set of a given size. */ public static Color getRandomColour() { // Same ideas as getRandomRBG, just returns a Color. if (generator == null) { generator = new Random(); } float h = generator.nextFloat(); if (h > 0.1f && h < 0.25f) { h -= 0.15f; // More reds, no yellows. } return Color.getHSBColor(h, 1.0F, 0.9F); } }