Customizing the Color Panel

Like the other standard application panels, NSColorPanel functionality can be extended by attaching an accessory view. To do this, use the -setAccessoryView: method. Pass the NSView that contains the controls as the argument. This is discussed in more depth in Chapter 9, “Applications, Windows, and Screens,” which discusses standard System panels.

Custom Color Pickers

Although Apple provides basic color picking methods, applications can also require custom color selection behavior. A custom color picker class needs to implement both the NSColorPickingDefault and NSColorPickingCustom protocols. Because the class NSColorPicker already implements the NSColorPickingDefault protocol, most custom pickers are implemented ...

Get Cocoa® Programming 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.