random Color from int range between 0 to 255 - Android Graphics

Android examples for Graphics:Random Color

Description

random Color from int range between 0 to 255

Demo Code


//package com.java2s;
import android.graphics.Color;
import java.util.Random;

public class Main {
    public static int randomColor() {

        Random rnd = new Random();
        return Color.argb(255, rnd.nextInt(256), rnd.nextInt(256),
                rnd.nextInt(256));/* w ww .  ja v a  2 s .c o  m*/
    }
}

Related Tutorials