类:TouchBarColorPicker
类:TouchBarColorPicker
¥Class: TouchBarColorPicker
在触摸栏中为原生 macOS 应用创建颜色选择器
¥Create a color picker in the touch bar for native macOS applications
进程:主进程
该类不是从 'electron'
模块导出的。它仅可用作 Electron API 中其他方法的返回值。
¥Process: Main
This class is not exported from the 'electron'
module. It is only available as a return value of other methods in the Electron API.
new TouchBarColorPicker(options)
实例属性
¥Instance Properties
以下属性在 TouchBarColorPicker
的实例上可用:
¥The following properties are available on instances of TouchBarColorPicker
:
touchBarColorPicker.availableColors
代表颜色选择器可供选择的颜色的 string[]
数组。更改此值会立即更新触摸栏中的颜色选择器。
¥A string[]
array representing the color picker's available colors to select. Changing this value immediately
updates the color picker in the touch bar.
touchBarColorPicker.selectedColor
代表颜色选择器当前选择的颜色的 string
十六进制代码。更改此值会立即更新触摸栏中的颜色选择器。
¥A string
hex code representing the color picker's currently selected color. Changing this value immediately
updates the color picker in the touch bar.