Daniel Souza Bertoldi
04/07/2023, 8:13 PMcolorFilter
of an Image
composable?
Best way I could find online was to use the drawWithCache { }
modifier and call drawRect
, but that doesn’t work the way I want to 😕 It creates a rect behind the image, not in the image. I’ve tried all the blend modes available and none worked. Am I missing something here?romainguy
04/07/2023, 8:34 PMromainguy
04/07/2023, 8:34 PMromainguy
04/07/2023, 8:34 PMromainguy
04/07/2023, 8:35 PMDaniel Souza Bertoldi
04/07/2023, 8:52 PMDaniel Souza Bertoldi
04/07/2023, 9:03 PM.graphicsLayer { alpha = 0.99F }
.drawWithContent {
drawContent()
drawRect(
brush = Brush.horizontalGradient(
0.3f to LightGrey,
1F to Color.Transparent,
),
blendMode = BlendMode.SrcIn,
)
}
Thanks once again!romainguy
04/07/2023, 9:06 PMromainguy
04/07/2023, 9:06 PMromainguy
04/07/2023, 9:07 PMromainguy
04/07/2023, 9:07 PMDaniel Souza Bertoldi
04/07/2023, 9:18 PMcompositeStrategy
parameter, I changed the alpha to this:
.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
Works too, thanks!romainguy
04/07/2023, 9:19 PMdewildte
04/10/2023, 12:23 PM