April 2015
Intermediate to advanced
556 pages
17h 47m
English
For your first foray into custom drawing, you will start small by drawing a gray background for the DieView and a green line that bisects the view diagonally. (Figure 17.6).
Figure 17.6 Drawing with NSColor and NSBezierPath
Your drawing will be done in three steps:
Set the color. The color is an instance of NSColor. NSColor can specify colors in the RGB, HSV, CMYK, and grayscale color spaces.
Construct the path. The path specifies the line, curve, or shape that you want to draw. The path is an instance of NSBezierPath. (If you need to draw the same path multiple times, you can store an instance of ...