Java tutorial
//package com.java2s; import java.util.Random; import android.graphics.Color; public class Main { public static int getRandomArgb(int alpha, int begin, int last) { if (last > 255) { last = 255; } int red = begin + new Random().nextInt(last - begin); int green = begin + new Random().nextInt(last - begin); int blue = begin + new Random().nextInt(last - begin); return Color.argb(alpha, red, green, blue); } }