Adopted By: NSColorPicker
Declared In: AppKit/NSColorPicking.h
Together with the NSColorPickingDefault protocol, NSColorPickingCustom provides a way to add color pickerscustom user interfaces for color selectionto an application's NSColorPanel. The NSColorPickingDefault protocol provides basic behavior for a color picker. The NSColorPicker class adopts the NSColorPickingDefault protocol. The easiest way to implement a color picker is to create a subclass of NSColorPicker and use it as a base upon which to add the NSColorPickingCustom protocol.
See also: NSColorPickingDefault, NSColorPicker (class)
Getting the Mode
- (int)currentMode Returns the color picker's current mode (or submode, if applicable). The returned value should be unique to your color picker. (NSColorPanel.h. defines unique values for the standard color pickers used by the Application Kit.)
- (BOOL)supportsMode:(int)mode Returns YES if the receiver supports the specified picking mode.
Getting the View
- (NSView *)provideNewView:(BOOL)firstRequest Returns the view containing the color picker's user interface. This message is sent to the color picker whenever the color panel attempts to display it; the argument indicates whether this is the first time the message has been sent. If firstRequest is YES, the method should perform any initialization required (such as lazily loading a nib file).
Setting the Current Color
- (void)setColor:(NSColor *)aColor Adjusts the color picker to make aColor the currently selected color.