Android examples for Graphics:Random Color
Returns a random color.
//package com.java2s; import android.graphics.Color; import java.util.Random; public class Main { private static Random randomGenerator = new Random(); /**/*from ww w. ja v a2s .co m*/ * Returns a random color. * @return */ public static int getRandomColor() { return Color.rgb(randomGenerator.nextInt(255), randomGenerator.nextInt(255), randomGenerator.nextInt(255)); } }