O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Challenge: Gradients

NSGradient can be used to draw gradients (ramps between two or more colors). Use NSGradient and NSBezierPath to draw the die face with a gradient effect. Hint: you will need to pass an instance of NSBezierPath describing the rounded rectangle to one of the methods on NSGradient.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required