public class ColorUtils {
public static int resourceColorAlpha(Context context, @ColorRes int colorResource, @IntRange(from = 0, to = 255) int alphaDecimal) {
int color = context.getResources().getColor(colorResource);
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return Color.parseColor("#" + Integer.toHexString(Color.argb(alphaDecimal, red, green, blue)));
}
}