Zum Hauptteil springen

Class: TouchBarColorPicker

Class: TouchBarColorPicker

Erstellen Sie eine Farbauswahl in der TouchBar für native MacOS-Anwendungen

Prozess: Haupt
Diese Klasse wird nicht aus dem 'electron' -Modul exportiert. Es ist nur als Rückgabewert anderer Methoden in der Electron-API verfügbar.

new TouchBarColorPicker(options)

  • options Objekt
    • availableColors string[] (optional) - Array of hex color strings to appear as possible colors to select.
    • selectedColor string (optional) - The selected hex color in the picker, 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.

Instanz Eigenschaften

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 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.