Signal2
Signal support.
ColorPicker.swift:1021class Signal2
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (25) members.
Types
enum ColorModeType
enum PickerShapeType
class Signal1
Signal support.
class Signal3
Signal support.
Type members
Instance members
var canAddSwatches: Bool
If
true
, it’s possible to add presets under Swatches. Iffalse
, the button to add presets is disabled.var color: Color
The currently selected color.
var colorChanged: Signal1
Emitted when the color is changed.
var colorMode: ColorPicker.ColorModeType
The currently selected color mode. See
ColorModeType
.var colorModesVisible: Bool
If
true
, the color mode buttons are visible.var deferredMode: Bool
If
true
, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues).var editAlpha: Bool
If
true
, shows an alpha channel slider (opacity).var hexVisible: Bool
If
true
, the hex color code input field is visible.var pickerShape: ColorPicker.PickerShapeType
The shape of the color space view. See
PickerShapeType
.var presetAdded: Signal2
Emitted when a preset is added.
var presetRemoved: Signal3
Emitted when a preset is removed.
var presetsVisible: Bool
If
true
, the Swatches and Recent Colors presets are visible.var samplerVisible: Bool
If
true
, the color sampler and color preview are visible.var slidersVisible: Bool
If
true
, the color sliders are visible.func addPreset(color: Color
) Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them.
func addRecentPreset(color: Color
) Adds the given color to a list of color recent presets so that it can be picked later. Recent presets are the colors that were picked recently, a new preset is automatically created and added to recent presets when you pick a new color.
func erasePreset(color: Color
) Removes the given color from the list of color presets of this color picker.
func eraseRecentPreset(color: Color
) Removes the given color from the list of color recent presets of this color picker.
func getPresets(
) -> PackedColorArray Returns the list of colors in the presets of the color picker.
func getRecentPresets(
) -> PackedColorArray Returns the list of colors in the recent presets of the color picker.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ color: Color) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)