https://kotlinlang.org logo
#compose
Title
# compose
s

ste

07/20/2022, 7:36 AM
How can I achieve this particular text blend using
Canvas
? Given the dark blue rect and the black text, how should I blend them? I tried every single
BlendMode
, but none of them gave the desired result. I need to whiten the part of the text that overlaps the rect (or, alternatively, clear the part or the rect the text would overlap)
1
Oh I think I just got it.
Copy code
clipPath(textPath, ClipOp.Difference) {
    drawDarkBlueRect()
}

// ^ this draws the blue rect with white (bg) "Comp"

clipRect(darkBlueRect, ClipOp.Difference) {
    drawTextPath()
}

// ^ this one draws the black "pose"
I'm gonna try this now
1
o

Oleksandr Balan

07/20/2022, 7:57 AM
s

ste

07/20/2022, 8:05 AM
I just tried that but it achieves a different thing - the clipping thing I posted above gets the exact result 🙂
3 Views