Anyone have any obvious ideas of how I might accomplish cross node Porter-Duff color mixing in compose? Wondering if there is some form of modifier hackery I could use to get things drawn into the same layer or if I would need to do two separate compositions where one is used inside of the canvas so that things can be mixed.
sandbox project here: https://github.com/trevjonez/SharedCanvasPoc/tree/master
End goal example as an image:
a
Albert Chang
10/25/2022, 2:29 AM
Your project isn’t public and I’m not sure what you mean by “cross node Porter-Duff color mixing”, but if you apply
Modifier.graphicsLayer(alpha = 0.99f)
to a composable, it and its children will be drawn into a composition layer so that some `BlendMode`s will work.
t
trevjones
10/25/2022, 4:04 AM
ahh ty for calling out the repo vis being private, I made it public.
So I definitely already have the alpha on for the canvas behavior. what is the right way to blend mode a text composable paint modifier I assume?
a
Albert Chang
10/25/2022, 4:24 AM
it and its children will be drawn into a composition layer
Ok so moved things around and have some blending happening. now I just need to figure out what goes where for the right effect.
BUT, this does prove it can be done.
Text composable obviously causing color mixing with the canvas text pixels
trevjones
10/26/2022, 11:43 AM
Ended up getting it all working yesterday. TY for the help @Albert Chang
Updated images on the readme so i can hand it off to my devs to use it.