0

Is it possible to get this kind of gradient in cocoa ? enter image description here

I can use simple CGContextDrawRadialGradient with clip made by CGContextAddEllipseInRect but the effect will slightly different.

Is it any posibility to draw exact this shade/gradient?

maseth
  • 841
  • 1
  • 11
  • 19

1 Answers1

2

I would use a radial gradient, and then apply a scale trasnformation such that the y coordinate is squiched, and the x remains.

There is an advanced topic where you can define your own gradients providing an callback that calculates the color or so. Ist stated in Core Graphics docu.

AlexWien
  • 28,470
  • 6
  • 53
  • 83
  • I thought about that, probably the density of black 'pigment' will be stronger on Y axis. Definitely worth to try. – maseth Feb 15 '13 at 17:42