Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Color; public class Main { public static int colorById(final int id) { int r = (150 - id * 25) % 255; int g = (200 + id * 75) % 255; int b = (125 + id * 125) % 255; return Color.rgb(r, g, b); } }