setColorAlpha

fun setColorAlpha(@ColorInt color: Int, @FloatRange(from = 0.0, to = 1.0) alpha: Float): Int

Method to get transparency from provided color

Return

int color

Parameters

color

pass the int color, i.e., you can send it from color resource file.

alpha

set alpha between 0.0f to 1.0f