generate random Color - Android Graphics

Android examples for Graphics:Random Color

Description

generate random Color

Demo Code


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

public class Main {
    public static int generateBeautifulColor() {
        Random random = new Random();

        int red = 30 + random.nextInt(200);
        int green = 30 + random.nextInt(200);
        int blue = 30 + random.nextInt(200);
        return Color.rgb(red, green, blue);
    }//from  w  w  w.  j a v  a  2  s  . co  m
}

Related Tutorials