electron/docs/api/touch-bar-color-picker.md

31 lines
1.2 KiB
Markdown
Raw Normal View History

2017-03-03 17:54:46 +00:00
## Class: TouchBarColorPicker
> Create a color picker in the touch bar for native macOS applications
Process: [Main](../glossary.md#main-process)<br />
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
2017-03-03 17:54:46 +00:00
### `new TouchBarColorPicker(options)`
2017-03-03 17:54:46 +00:00
* `options` Object
* `availableColors` string[] (optional) - Array of hex color strings to
2017-03-03 17:54:46 +00:00
appear as possible colors to select.
* `selectedColor` string (optional) - The selected hex color in the picker,
2017-03-03 17:54:46 +00:00
i.e `#ABCDEF`.
* `change` Function (optional) - Function to call when a color is selected.
* `color` string - The color that the user selected from the picker.
2017-03-03 17:54:46 +00:00
### Instance Properties
The following properties are available on instances of `TouchBarColorPicker`:
#### `touchBarColorPicker.availableColors`
A `string[]` array representing the color picker's available colors to select. Changing this value immediately
2017-03-03 17:54:46 +00:00
updates the color picker in the touch bar.
#### `touchBarColorPicker.selectedColor`
A `string` hex code representing the color picker's currently selected color. Changing this value immediately
2017-03-03 17:54:46 +00:00
updates the color picker in the touch bar.