Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Color; public class Main { public static int getColor(int baseColor, float alphaPercent) { int alpha = Math.round(Color.alpha(baseColor) * alphaPercent); return (baseColor & 0x00FFFFFF) | (alpha << 24); } }