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