An abstract superclass that implements the NSColorPickingDefault protocol.


class NSColorPicker : NSObject


The NSColorPickingDefault and NSColorPickingCustom protocols define a way to add color pickers (custom user interfaces for color selection) to the color panel.


Initializing an NSColorPicker Object

init?(pickerMask: Int, colorPanel: NSColorPanel)

Initializes the color picker with the specified color panel and color picker mode mask.

Getting the Color Panel

var colorPanel: NSColorPanel

The NSColorPanel instance that owns the color picker.

Adding Button Images

func insertNewButtonImage(NSImage, in: NSButtonCell)

Sets the image used for the specified button cell.

var provideNewButtonImage: NSImage

The button image used by the color picker.

Setting the Mode

func setMode(NSColorPanel.Mode)

Does nothing. Override to set the color picker’s mode.

Managing Color Lists

func attachColorList(NSColorList)

Does nothing. Override to attach a color list to a color picker.

func detachColorList(NSColorList)

Does nothing. Override to detach a color list from a color picker.

Responding to View Changes

func viewSizeChanged(Any?)

Does nothing. Override to respond to a size change.

Customizing the Color Picker

var buttonToolTip: String

The tool tip that is shown when the mouse cursor is over the color picker’s button image.

var minContentSize: NSSize

the minimum content size.


Inherits From

See Also

Color Panels

class NSColorPanel

A standard user interface for selecting color in an app.

protocol NSColorPickingCustom

A set of methods that provides a way to add color pickers—custom user interfaces for color selection—to an app’s color panel.

protocol NSColorPickingDefault

A set of methods that provides basic behavior for a color picker.