Jérémy CROS
07/25/2024, 1:09 PMstyle = AppTheme.typography.instructionText.copy(
Brush.verticalGradient(
listOf(AppTheme.colors.contentPrimary, Color.Transparent)
)
)
But the gradient is applied linearly on the whole text, not just the end
Figured I should be able to use startY and endY parameters but I can't seem to be able to understand how they work...
Or maybe I'm not using the proper gradient?
Any help appreciated 🙂Rebecca Franks
07/25/2024, 1:13 PM@Composable
fun FadedEdgeDemo(modifier: Modifier, content: @Composable () -> Unit) {
Box(modifier = modifier
.graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen)
.drawWithContent {
drawContent()
drawRect(
brush = Brush.verticalGradient(listOf(Color.Black, Color.Transparent)),
blendMode = BlendMode.DstIn
)
}) {
content()
}
}
Jérémy CROS
07/25/2024, 1:47 PM