Travis Griggs
04/08/2024, 9:23 PMromainguy
04/08/2024, 9:27 PMTravis Griggs
04/08/2024, 9:32 PM.drawWithContent {
val brush = Brush.verticalGradient(listOf(Color.Cyan, Color.Orange))
drawContent()
drawRect(brush, blendMode = BlendMode.SrcAtop)
},
does the internal drawContent() there draw to an intermediate layer?romainguy
04/08/2024, 9:34 PMTravis Griggs
04/08/2024, 10:02 PM.graphicsLayer {
compositingStrategy = CompositingStrategy.Offscreen
}
I've applied that to my Text (it's actually a LazyList with a bunch of Texts in it). I can make my gradient:
Brush.verticalGradient(
0f to Color.Red.copy(alpha = 0f ),
padRows.toFloat() / lineCount to Color.Blue.copy(alpha = 1f),
(padRows + 1).toFloat() / lineCount to Color.Blue.copy(alpha = 1f),
1f to Color.Green.copy(alpha = 0.0f)
)
It's not clear to me how I get my offscreen list of Texts to draw "through" my gradient (dstIn or dstOut). Do I use any of the "drawWith" things for this?Travis Griggs
04/08/2024, 10:20 PMLazyList(modifier.graphicsLayer {
compositingStrategy = CompositingStrategy.Offscreen
}
.drawWithContent {
drawContent()
drawRect(brush, blendMode = BlendMode.SrcIn)
},...
romainguy
04/08/2024, 11:45 PMTravis Griggs
04/09/2024, 1:18 AM