8

I want to create custom paths with a gradient along with it, something like on the image: enter image description here

How do I do that with SwiftUI?

UPD. I know about linear, angular, radial gradients described in apple documentation. Now I use a combination of linear gradients: enter image description here

But I don't know how to create a custom shape like this: enter image description here

  • While not SwiftUI, have you looked at the accepted answer here: https://stackoverflow.com/questions/41437581/how-to-fill-a-bezier-path-with-gradient-color – elprl Feb 19 '21 at 18:33

1 Answers1

1

mask modifier

LinearGradient(…).mask(myPath.stroke(…))
Benj
  • 736
  • 7
  • 21