Simply put: is it possible to fade between two NSGradient "fills" on a single NSView? Eg. draw one gradient and fade to drawing the next one.
Asked
Active
Viewed 312 times
0
-
Ugh, It's certainly possible, but AppKit is going to fight you on the animated bit. – CodaFi Dec 31 '12 at 23:46
1 Answers
2
I ended up subclassing NSView; getting an NSImage from it; creating a temporary NSView drawing the new gradient which is the same size as the original and getting an image from that; drawing the starting image in an NSImageView, which is a subview of the original NSView; then using a CATransition to fade to another NSImageView with the new image. Finally, I'd get my NSView drawing the new gradient and remove the NSImageView, in case any more custom drawing was to be done.

Seb Jachec
- 3,003
- 2
- 30
- 56