ColorPicker

package
v0.0.0-...-c909628 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package ColorPicker provides methods for working with ColorPicker object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsColorPicker() Instance
}

type ColorModeType

type ColorModeType = gdclass.ColorPickerColorModeType //gd:ColorPicker.ColorModeType
const (
	/*Allows editing the color with Red/Green/Blue sliders.*/
	ModeRgb ColorModeType = 0
	/*Allows editing the color with Hue/Saturation/Value sliders.*/
	ModeHsv ColorModeType = 1
	/*Allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR).*/
	ModeRaw ColorModeType = 2
	/*Allows editing the color with Hue/Saturation/Lightness sliders.
	  OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue.
	  [url=https://bottosson.github.io/posts/colorpicker/]Okhsv and Okhsl color spaces[/url]*/
	ModeOkhsl ColorModeType = 3
)

type Instance

type Instance [1]gdclass.ColorPicker

A widget that provides an interface for selecting or modifying a color. It can optionally provide functionalities like a color sampler (eyedropper), color modes, and presets. [b]Note:[/b] This control is the color picker widget itself. You can use a [ColorPickerButton] instead if you need a button that brings up a [ColorPicker] in a popup.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddPreset

func (self Instance) AddPreset(color Color.RGBA)

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. [b]Note:[/b] The presets list is only for [i]this[/i] color picker.

func (Instance) AddRecentPreset

func (self Instance) AddRecentPreset(color Color.RGBA)

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. [b]Note:[/b] The recent presets list is only for [i]this[/i] color picker.

func (Instance) AsBoxContainer

func (self Instance) AsBoxContainer() BoxContainer.Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsColorPicker

func (self Instance) AsColorPicker() Instance

func (Instance) AsContainer

func (self Instance) AsContainer() Container.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsVBoxContainer

func (self Instance) AsVBoxContainer() VBoxContainer.Instance

func (Instance) CanAddSwatches

func (self Instance) CanAddSwatches() bool

func (Instance) Color

func (self Instance) Color() Color.RGBA

func (Instance) ColorMode

func (self Instance) ColorMode() gdclass.ColorPickerColorModeType

func (Instance) ColorModesVisible

func (self Instance) ColorModesVisible() bool

func (Instance) DeferredMode

func (self Instance) DeferredMode() bool

func (Instance) EditAlpha

func (self Instance) EditAlpha() bool

func (Instance) ErasePreset

func (self Instance) ErasePreset(color Color.RGBA)

Removes the given color from the list of color presets of this color picker.

func (Instance) EraseRecentPreset

func (self Instance) EraseRecentPreset(color Color.RGBA)

Removes the given color from the list of color recent presets of this color picker.

func (Instance) GetPresets

func (self Instance) GetPresets() []Color.RGBA

Returns the list of colors in the presets of the color picker.

func (Instance) GetRecentPresets

func (self Instance) GetRecentPresets() []Color.RGBA

Returns the list of colors in the recent presets of the color picker.

func (Instance) HexVisible

func (self Instance) HexVisible() bool

func (Instance) OnColorChanged

func (self Instance) OnColorChanged(cb func(color Color.RGBA))

func (Instance) OnPresetAdded

func (self Instance) OnPresetAdded(cb func(color Color.RGBA))

func (Instance) OnPresetRemoved

func (self Instance) OnPresetRemoved(cb func(color Color.RGBA))

func (Instance) PickerShape

func (self Instance) PickerShape() gdclass.ColorPickerPickerShapeType

func (Instance) PresetsVisible

func (self Instance) PresetsVisible() bool

func (Instance) SamplerVisible

func (self Instance) SamplerVisible() bool

func (Instance) SetCanAddSwatches

func (self Instance) SetCanAddSwatches(value bool)

func (Instance) SetColor

func (self Instance) SetColor(value Color.RGBA)

func (Instance) SetColorMode

func (self Instance) SetColorMode(value gdclass.ColorPickerColorModeType)

func (Instance) SetColorModesVisible

func (self Instance) SetColorModesVisible(value bool)

func (Instance) SetDeferredMode

func (self Instance) SetDeferredMode(value bool)

func (Instance) SetEditAlpha

func (self Instance) SetEditAlpha(value bool)

func (Instance) SetHexVisible

func (self Instance) SetHexVisible(value bool)

func (Instance) SetPickerShape

func (self Instance) SetPickerShape(value gdclass.ColorPickerPickerShapeType)

func (Instance) SetPresetsVisible

func (self Instance) SetPresetsVisible(value bool)

func (Instance) SetSamplerVisible

func (self Instance) SetSamplerVisible(value bool)

func (Instance) SetSlidersVisible

func (self Instance) SetSlidersVisible(value bool)

func (Instance) SlidersVisible

func (self Instance) SlidersVisible() bool

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type PickerShapeType

type PickerShapeType = gdclass.ColorPickerPickerShapeType //gd:ColorPicker.PickerShapeType
const (
	/*HSV Color Model rectangle color space.*/
	ShapeHsvRectangle PickerShapeType = 0
	/*HSV Color Model rectangle color space with a wheel.*/
	ShapeHsvWheel PickerShapeType = 1
	/*HSV Color Model circle color space. Use Saturation as a radius.*/
	ShapeVhsCircle PickerShapeType = 2
	/*HSL OK Color Model circle color space.*/
	ShapeOkhslCircle PickerShapeType = 3
	/*The color space shape and the shape select button are hidden. Can't be selected from the shapes popup.*/
	ShapeNone PickerShapeType = 4
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL