internal

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 3 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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