Tash
03/07/2022, 4:17 AMText
with a horizontal gradient. After much trial and error, found that this works only if I specify alpha = 0.99f
in the graphicsLayer
(output in 🧵)
Can someone explain why? 😖
Text(
text = "$ 20",
modifier = Modifier.graphicsLayer(alpha = 0.99f)
.drawWithCache {
val brush = Brush.horizontalGradient(listOf(StartColor, EndColor))
onDrawWithContent {
drawContent()
drawRect(brush, blendMode = BlendMode.SrcAtop)
}
},
)
Albert Chang
03/07/2022, 6:05 AMTash
03/07/2022, 7:03 AMColton Idle
06/29/2022, 4:40 PMColton Idle
06/29/2022, 7:32 PM