Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static String get_Random_Color() { String[] arr = { "#f44336", "#ff4081", "#ff5722", "#ff9800", "#03a9f4", "#009688", "#388e3c" }; Random rand = new Random(); int max = 5; int min = 0; int num = rand.nextInt((max - min) + 1 + min); return arr[num]; } }