Here you can find the source of getRandColor(int fc, int bc)
private static Color getRandColor(int fc, int bc)
//package com.java2s; //License from project: Open Source License import java.awt.*; import java.util.Random; public class Main { private static Color getRandColor(int fc, int bc) { int f = fc; int b = bc; Random random = new Random(); if (f > 255) { f = 255;//from w w w. j a va 2s . com } if (b > 255) { b = 255; } return new Color(f + random.nextInt(b - f), f + random.nextInt(b - f), f + random.nextInt(b - f)); } }