Wilberforce Uwadiegwu
07/22/2025, 2:45 PM@Composable
private fun GradientText() {
val brush = Brush.linearGradient(colors = listOf(Color.Blue, Color.Green, Color.Red, Color.Yellow))
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
Text(
text = buildAnnotatedString {
append("Do not allow people to dim your shine ")
withStyle(
SpanStyle(brush = brush)
) {
append("because they are blinded.")
}
append(" Tell them to put some sunglasses on.")
}
)
Text(
text = buildAnnotatedString {
append("Do not allow people to dim your shine ")
withStyle(
SpanStyle(brush = brush)
) {
append("because")
}
append(" Tell them to put some sunglasses on.")
}
)
}
}
Is there any way around this?Wilberforce Uwadiegwu
07/22/2025, 2:51 PMText(
text = "because",
style = TextStyle(brush = brush)
)
Seri
07/22/2025, 3:03 PMHalil Ozercan
07/22/2025, 3:09 PMHalil Ozercan
07/22/2025, 3:11 PMNitesh Singh
07/22/2025, 4:32 PMSeri
07/22/2025, 4:35 PMHalil Ozercan
07/23/2025, 12:20 AMNitesh Singh
07/23/2025, 9:50 AMChrimaeon
07/23/2025, 10:06 AMChrimaeon
07/23/2025, 10:09 AMor ``
.Nitesh Singh
07/23/2025, 10:31 AMHalil Ozercan
07/23/2025, 2:28 PMSeri
07/23/2025, 2:32 PM