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

For the More Curious: More on NSColor

The intricacies of the NSColor class are beyond the scope of this book, but the basics are sufficient for most Cocoa programming.

NSColor provides a number of class methods returning common colors. Here is a sampling:

 ​ ​c​l​a​s​s​ ​f​u​n​c​ ​b​l​a​c​k​C​o​l​o​r​(​)​ ​-​>​ ​N​S​C​o​l​o​r​
 ​ ​c​l​a​s​s​ ​f​u​n​c​ ​p​u​r​p​l​e​C​o​l​o​r​(​)​ ​-​>​ ​N​S​C​o​l​o​r​
 ​ ​c​l​a​s​s​ ​f​u​n​c​ ​c​l​e​a​r​C​o​l​o​r​(​)​ ​-​>​ ​N​S​C​o​l​o​r​

If you are creating custom controls, you will often want them to blend in with the system. Since colors used in the system can vary from major releases of OS X, and since some colors (such as the highlight color) are configurable by the user, NSColor provides class ...

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