palette

package
v1.3.343 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EGA added in v1.2.141

func EGA(i EGAIndex, a uint8) color.NRGBA

func Init added in v1.2.141

func Init(w, h int) error

func Names

func Names() []string

Names returns the names of all palettes, in quoted comma separated for, for inclusion in a flag description.

func Parse added in v1.2.141

func Parse(s string, name string) (color.NRGBA, error)

func SaveCachedLUTs added in v1.2.164

func SaveCachedLUTs(w, h int, dir string) error

func SetCurrent added in v1.2.141

func SetCurrent(pal *Palette, doRemap bool) bool

SetCurrent changes the current palette. Returns whether the remapping table changed.

Types

type EGAIndex added in v1.2.141

type EGAIndex int
const (
	Black EGAIndex = iota
	Blue
	Green
	Cyan
	Red
	Magenta
	Brown
	LightGrey
	DarkGrey
	LightBlue
	LightGreen
	LightCyan
	LightRed
	LightMagenta
	Yellow
	White
	EGACount
)

type Palette

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

Palette encapsulates a color palette.

func ByName

func ByName(name string) *Palette

ByName returns the PalData for the given palette. Do not modify the returned object.

func Current added in v1.2.141

func Current() *Palette

func (*Palette) ApplyToImage added in v1.2.141

func (p *Palette) ApplyToImage(img image.Image, name string) image.Image

ApplyToImage applies this palette's associated color remapping to an image.

func (*Palette) ApplyToNRGBA added in v1.2.141

func (p *Palette) ApplyToNRGBA(col color.NRGBA, name string) color.NRGBA

ApplyToNRGBA applies this palette's associated col remapping to a single col.

func (*Palette) ApplyToRGBA added in v1.2.141

func (p *Palette) ApplyToRGBA(col color.RGBA, name string) color.RGBA

ApplyToRGBA applies this palette's associated col remapping to a single col.

func (*Palette) BayerPattern

func (p *Palette) BayerPattern(size int) []float32

BayerPattern computes the Bayer pattern for this palette.

func (*Palette) HalftonePattern added in v1.1.280

func (p *Palette) HalftonePattern(size int) []float32

HalftonePattern computes the Halftone pattern for this palette.

func (*Palette) ToLUT

func (p *Palette) ToLUT(bounds image.Rectangle, numLUTs int) (image.Image, int, int, int)

Jump to

Keyboard shortcuts

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