Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Color; public class Main { public static int getPrimaryDarkColor(int color) { double tran = 0.8; int a = Color.alpha(color); int r = Color.red(color); int g = Color.green(color); int b = Color.blue(color); return Color.argb(a, Math.max((int) (r * tran), 0), Math.max((int) (g * tran), 0), Math.max((int) (b * tran), 0)); } }