Android examples for Graphics:Color Operation
calculate the color of the image for a new session
//package com.java2s; import java.util.Random; public class Main { private final static int MAX_VAL = 0xFF; public static int imageColorSelector() { int color = 0; Random random = new Random(); int aa = MAX_VAL << 24; int rr = ((int) ((random.nextDouble() * 256))) << 16; int gg = ((int) ((random.nextDouble() * 256))) << 8; int bb = ((int) ((random.nextDouble() * 256))); color = (((aa | rr) | gg) | bb); return color; }//from w w w .j a va2s. c om }