withAlpha

fun withAlpha(color: Int, alpha: Int): Int

Returns the especified color with an added alpha channel. That means a transparent/opaque color.

alpha ranges from 0 (completely transparent) to 255 (completely visible). Values outside this range are coerced into it.