get Random Color - Android Graphics

Android examples for Graphics:Random Color

Description

get Random Color

Demo Code


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

public class Main {
    public static int getRandomColor() {

        Random random = new Random();

        int red = random.nextInt(200) + 30;
        int gre = random.nextInt(200) + 30;
        int blu = random.nextInt(200) + 30;

        return Color.rgb(red, gre, blu);
    }/*w w  w  .j  av a 2s. c  o m*/
}

Related Tutorials