Generate random Color from random RGB value - Android Graphics

Android examples for Graphics:Color Value

Description

Generate random Color from random RGB value

Demo Code


//package com.java2s;

import android.graphics.Color;

import java.util.Random;

public class Main {
    public static int randomColor() {
        Random random = new Random();
        return Color.argb(255, random.nextInt(256), random.nextInt(256),
                random.nextInt(256));/*from   w  w  w  .  j  av a2  s  .c  om*/
    }
}

Related Tutorials