'how to change text color Opacity in jetpack compose

how can i change the opacity of Text Color.White in JetPack Compose

Text(text = funfact , fontSize = 18.sp, color = Color.White )


Solution 1:[1]

You can change the alpha channel from the Color attribute:

Text(text = funfact, fontSize = 18.sp, color = Color.White.copy(alpha = 0.5f))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stephen Vinouze