跳到主内容

类: TouchBarColorPicker

类: TouchBarColorPicker

在macOS 应用程序中,为触控栏创建拾色器

Process: Main
此类不从 'electron' 模块导出. 它只能作为Electron API中其他方法的返回值。

new TouchBarColorPicker(options)

  • 选项 对象
    • availableColors String[] (可选) - 由可选的十六进位色值组成的字符串数组.
    • backgroundColorString (可选) - 拾色器选中的颜色十六进位色值,例如 #ABCDEF
    • change Function (optional) - Function to call when a color is selected.
      • color String - 用户从拾色器中选取的颜色.

实例属性

以下为TouchBarColorPicker 实例的可用属性:

touchBarColorPicker.availableColors

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

A String hex code representing the color picker's currently selected color. Changing this value immediately updates the color picker in the touch bar.