Class

NSColorPickerTouchBarItem

A bar item that provides a system-defined color picker.

Topics

Creating a Color Picker Item

class func colorPicker(withIdentifier: NSTouchBarItem.Identifier)

Creates a bar item with the standard color picker icon.

class func textColorPicker(withIdentifier: NSTouchBarItem.Identifier)

Creates a bar item with the standard text color picker icon.

class func strokeColorPicker(withIdentifier: NSTouchBarItem.Identifier)

Creates a bar item with the standard stroke color picker icon.

class func colorPicker(withIdentifier: NSTouchBarItem.Identifier, buttonImage: NSImage)

Creates a color picker bar item using the supplied image as its icon.

Configuring the Color Picker

var colorList: NSColorList!

The list of colors displayed in the color picker.

var allowedColorSpaces: [NSColorSpace]?

Controls the color spaces that the color picker can produce.

var showsAlpha: Bool

A Boolean value that controls whether the color picker allows picking of colors with alpha values other than 1.0.

var isEnabled: Bool

A Boolean value that determines whether the color picker is enabled.

Obtaining the Selected Color

var color: NSColor

The picker's currently selected color.

var target: AnyObject?

An object that is notified when a user interacts with the color picker.

var action: Selector?

The selector on the target object that is invoked when a user interacts with the color picker.

Configuring Bar Customization

var customizationLabel: String!

The user-visible string identifying this item during touch bar customization.

Relationships

Inherits From

Conforms To

See Also

Touch Bar Items

class NSTouchBarItem

A UI control shown in the Touch Bar on supported models of MacBook Pro.

class NSCandidateListTouchBarItem

A bar item that, along with its delegate, provides a list of textual suggestions for the current text view.

class NSCustomTouchBarItem

A bar item that contains a responder of your choice, such as a view, a button, or a scrubber (an instance of the NSScrubber class).

class NSGroupTouchBarItem

A bar item that provides a bar to contain other items.

class NSPopoverTouchBarItem

A bar item that provides a two-state control that can expand into its second state, showing the contents of a bar that it owns.

class NSSharingServicePickerTouchBarItem

A bar item that, along with its delegate, provides a list of objects eligible for sharing.

class NSSliderTouchBarItem

A bar item that provides a slider control for choosing a value in a range.