The NSColorPickingDefault protocol, together with the NSColorPickingCustom protocol, provides an interface for adding color pickers—custom user interfaces for color selection—to an application’s NSColorPanel instance. The NSColorPickingDefault protocol provides basic behavior for a color picker. The NSColorPickingCustom protocol provides implementation-specific behavior.


Creating Color Pickers

init?(pickerMask: Int, colorPanel: NSColorPanel)

Initializes the receiver with a given color panel and its mode.

Configuring Color Pickers

func setMode(NSColorPanelMode)

Specifies the receiver’s mode.

func insertNewButtonImage(NSImage, in: NSButtonCell)

Sets the image of a given button cell.

func provideNewButtonImage()

Provides the image of the button used to select the receiver in the color panel.

func minContentSize()

Indicates the receiver’s minimum content size.

func buttonToolTip()

Provides the toolbar button help tag.

Handling Events

func alphaControlAddedOrRemoved(Any?)

Sent when the color panel's opacity controls have been hidden or displayed.

func viewSizeChanged(Any?)

Tells the recever when the color panel's view size changes in a way that might affect the color picker.

Managing Color Lists

func attachColorList(NSColorList)

Tells the receiver to attach the given color list, if it isn’t already displaying the list.

func detachColorList(NSColorList)

Tells the receiver to detach the given color list, unless the receiver isn’t displaying the list.


Adopted By