Here you can find the source of getRandomRgb()
private static int[] getRandomRgb()
//package com.java2s; import java.util.Random; public class Main { private static Random random = new Random(); private static int[] getRandomRgb() { int[] rgb = new int[3]; for (int i = 0; i < 3; i++) { rgb[i] = random.nextInt(255); }//from www .ja va 2 s . co m return rgb; } }