random Color for each of its R G B values - Android Graphics

Android examples for Graphics:Color Value

Description

random Color for each of its R G B values

Demo Code


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

public class Main {

    public static int randomColor() {
        Random random = new Random();

        int red = random.nextInt(150) + 50;

        int green = random.nextInt(150) + 50;

        int blue = random.nextInt(150) + 50;

        return Color.rgb(red, green, blue);
    }//from  w w w .  j a  va 2s.c  o m
}

Related Tutorials