Does anyone know if it's possible to transparently mask images? I have a usecase where the image should blend into the background with a gradient, but I haven't been able to figure out a method that does the trick.
solved 1
Tom De Decker
09/28/2023, 1:54 PM
What I've tried (this uses Coil's AsyncImage but Compose's Image seems to behave the same):
I've placed this composable inside a box with a green background but the preview does not show the color blending with the image and instead the image just seems to fade to what I presume is black:
r
romainguy
09/28/2023, 2:31 PM
You're almost there. What you want is a graphicsLayer with an offscreen compositing strategy set on it
romainguy
09/28/2023, 2:32 PM
This will create an intermediate transparent image for the effect to work