color

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Palette

type Palette struct {
	// contains filtered or unexported fields
}

Palette is a color picker for a Palette of colors

func NewPalette

func NewPalette(x, y int) *Palette

NewPalette creates a Palette at the specified location for the specified colors

func (*Palette) Bounds

func (p *Palette) Bounds() image.Rectangle

Bounds returns a rectangle indicating the visible boundaries of the Palette

func (*Palette) Draw

func (p *Palette) Draw(screen *ebiten.Image)

Draw renders the Palette to a screen

func (*Palette) PreferredSize

func (p *Palette) PreferredSize() (sx, sy int)

PreferredSize calculates the desired width and height of the Palette

func (*Palette) SetPosition

func (p *Palette) SetPosition(x, y int)

SetPosition changes the XY coordinate of the upper-left pixel

func (*Palette) SetSize

func (p *Palette) SetSize(sx, sy int)

SetSize changes the width and height

func (*Palette) SetVisible

func (p *Palette) SetVisible(visible bool)

SetVisible changes the visibility of the Palette

func (*Palette) Update

func (p *Palette) Update() error

Update checks for any mouse clicks on the Palette

type Preview

type Preview struct {
	// contains filtered or unexported fields
}

Preview displays the currently selected FG and BG colors

func NewPreview

func NewPreview(x, y int) *Preview

NewPreview creates a new Preview with the specified size and colors

func (*Preview) Bounds

func (p *Preview) Bounds() image.Rectangle

Bounds returns a Rectangle defining the visible area occupied by the Preview

func (*Preview) Draw

func (p *Preview) Draw(screen *ebiten.Image)

Draw renders the Preview to a screen

func (*Preview) PreferredSize

func (p *Preview) PreferredSize() (sx, sy int)

PreferredSize calculated the desired height and width of the Preview

func (*Preview) SetPosition

func (p *Preview) SetPosition(x, y int)

SetPosition changes the XY coordinate of the upper-left pixel

func (*Preview) SetSize

func (p *Preview) SetSize(sx, sy int)

SetSize changes the width and height of the Preview (NOT IMPLEMENTED)

func (*Preview) SetVisible

func (p *Preview) SetVisible(visible bool)

SetVisible changes the visibility of the Preview

func (*Preview) Update

func (p *Preview) Update() error

Update calls Update for the FG and BG swatches

type Swatch

type Swatch struct {
	// contains filtered or unexported fields
}

Swatch is a color swatch

func NewSwatch

func NewSwatch(size int, color color.Color) *Swatch

NewSwatch creates a Swatch of the specified color

func (*Swatch) Bounds

func (s *Swatch) Bounds() image.Rectangle

Bounds returns a rectangle indicating the visible bounds of the Swatch

func (*Swatch) Draw

func (s *Swatch) Draw(screen *ebiten.Image)

Draw renders a Swatch to a screen

func (*Swatch) PreferredSize

func (s *Swatch) PreferredSize() (int, int)

PreferredSize calculates the desired width and height of the Swatch

func (*Swatch) SetPosition

func (s *Swatch) SetPosition(x, y int)

SetPosition changes the XY coordinate of the upper-left pixel

func (*Swatch) SetSize

func (s *Swatch) SetSize(sx, sy int)

SetSize changes the width and height of the swatch

func (*Swatch) SetVisible

func (s *Swatch) SetVisible(visible bool)

SetVisible changes the visibility of the Swatch

func (*Swatch) Swap

func (s *Swatch) Swap(color color.Color) (prev color.Color)

Swap changes the color of the Swatch

func (*Swatch) Update

func (s *Swatch) Update() error

Update checks for a mouse click inside the swatch (NOT IMPLEMENTED)

Jump to

Keyboard shortcuts

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