Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClosestColorPicker ¶
type ClosestColorPicker[RGB ~uint32, Color ~uint8] struct { Palette [64]RGB Cache map[color.Color]Color }
ClosestColorPicker uses generic types to avoid importing pi.RGB and pi.Color (no cycles)
func (*ClosestColorPicker[RGB, Color]) IndexInPalette ¶
func (c *ClosestColorPicker[RGB, Color]) IndexInPalette(rgba color.Color) (Color, error)
type PaletteMaker ¶
type PaletteMaker[T ~uint32] struct { // contains filtered or unexported fields }
PaletteMaker automatically assign indexes to all visited colors. If color was added before, then it is not added again.
func (*PaletteMaker[T]) Add ¶
func (p *PaletteMaker[T]) Add(c color.Color) bool
Add returns true, when there is no space left
func (*PaletteMaker[T]) Palette ¶
func (p *PaletteMaker[T]) Palette() [maxColors]T
Click to show internal directories.
Click to hide internal directories.