colorpicker

package module
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 12 Imported by: 19

README

GitHub release (latest SemVer) PkgGoDev Go Report Card GitHub

colorpicker

Color picker component for Fyne

Usage

picker := colorpicker.New(200 /* height */, colorpicker.StyleHue /* Style */)
picker.SetOnChanged(func(c color.Color) {
    // called when the color is changed on the picker
    fmt.Println(c)
})

// you can use it just like any other Fyne widget
fyne.NewContainer(picker)

Documentation

See pkg.go.dev

Example

colorpicker

You can see all the styles implemented.

colorpicker/cmd/colorpicker/


colorpicker-popup

Example of embedding in Fyne's custom dialog.

colorpicker/cmd/colorpicker-popup/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorPicker

type ColorPicker interface {
	fyne.CanvasObject

	SetColor(color.Color)
	SetOnChanged(func(color.Color))
}

ColorPicker represents color picker component.

func New

func New(size float32, style PickerStyle) ColorPicker

New returns color picker container.

type PickerOpenWidget added in v0.4.0

type PickerOpenWidget interface {
	fyne.CanvasObject

	SetColor(color.Color)
	SetOnChange(f func(color.Color))
	SetPickerStyle(s PickerStyle)
}

PickerOpenWidget represents a widget that can open a color picker.

func NewColorSelectModalRect added in v0.4.0

func NewColorSelectModalRect(parent fyne.Window, minSize fyne.Size, defalutColor color.Color) PickerOpenWidget

NewColorSelectModalRect returns a rectangle that can be tapped to open a color picker modal.

type PickerStyle

type PickerStyle int

PickerStyle represents how the picker is displayed.

const (
	// StyleHue is style to display saturation-value area and vertical hue bar.
	StyleHue PickerStyle = iota
	// StyleHueCircle is style to display saturation-value area and circle hue bar.
	StyleHueCircle
	// StyleValue is style to display hue-saturation area and vertical value bar.
	StyleValue
	// StyleSaturation is style to display hue-value area and vertical saturation bar.
	StyleSaturation
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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