Here you can find the source of getRandomBrightColor()
public static Color getRandomBrightColor()
//package com.java2s; /**/*from w ww . j av a 2 s .com*/ * Copyright? 2014-2016 LIST (Luxembourg Institute of Science and Technology), all right reserved. * Authorship : Olivier PARISOT, Yoanne DIDRY * Licensed under GNU General Public License version 3 */ import java.awt.Color; import java.util.Random; public class Main { public static Color getRandomBrightColor() { final Color mix = Color.WHITE; final Random random = new Random(); int red = random.nextInt(256); int green = random.nextInt(256); int blue = random.nextInt(256); // mix the color if (mix != null) { red = (red + mix.getRed()) / 2; green = (green + mix.getGreen()) / 2; blue = (blue + mix.getBlue()) / 2; } return new Color(red, green, blue); } }