How to draw a multi-colored path on a Jetpack Compose canvas

390 Views Asked by At

I'd like to draw a path that consists of multiple colors on a Jetpack Compose canvas. The color of the path changes when it gets above or below a certain Y value. See screenshot below.

I know that paths are limited to a single color. Would I have to draw multiple paths to accomplish this? Or perhaps there's some kind of color mask I can overlay on top of this?

enter image description here

0

There are 0 best solutions below