setMode(_:)
Specifies the receiver’s mode.
Declaration
@MainActor func setMode(_ mode: NSColorPanel.Mode)Parameters
- mode:
The color picker mode. The available modes are described in 20000792.
Discussion
This method is invoked by the NSColorPanel method mode method to ensure the color picker reflects the current mode. For example, invoke this method during color picker initialization to ensure that all color pickers are restored to the mode the user left them in the last time an NSColorPanel was used.
Most color pickers have only one mode and thus don’t need to do any work in this method. An example of a color picker that uses this method is the slider picker, which can choose from one of several submodes depending on the value of mode.