how can i change the opacity of Text Color.White in JetPack Compose
Text(text = funfact , fontSize = 18.sp, color = Color.White )
how can i change the opacity of Text Color.White in JetPack Compose
Text(text = funfact , fontSize = 18.sp, color = Color.White )
You can change the alpha channel from the Color attribute:
Text(text = funfact, fontSize = 18.sp, color = Color.White.copy(alpha = 0.5f))
You can also user the alpha modifier :
Text(
text = funfact,
modifier = Modifier.alpha(0.5f),
fontSize = 18.sp,
color = Color.White,
)