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.

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.