0

I need to draw a circle with a gradient that starts with red and ends with blue. It should look like this one

How to create such circle is explained here. But I have no idea how to draw such gradient. The problem is that the start color and end color are mixed. Can you help me?

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

The second image, as @Putz1103 said, is just a linear gradient with a mask.

But what you are trying to do (as the first image suggests) is an angle gradient, not a circular gradient.

Here is an image of the three gradients with the same colors: linear, radial, angle: enter image description here

Unfortunately CoreGraphics doesn't provide a way to create an angle gradient. But you could fake it in another way, like drawing small shapes with different colors around a circle. Here is how: https://stackoverflow.com/a/12775798/942420

Community
  • 1
  • 1
Odrakir
  • 4,254
  • 1
  • 20
  • 52