Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
addPreset(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.
ColorPicker.swift:726final func addPreset(color: Color)
Other members in extension
Types
enum ColorModeType
enum PickerShapeType
class Signal1
Signal support.
class Signal2
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 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.