palette

package
v1.5.54 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BayerPattern added in v1.4.72

func BayerPattern(size int) []float32

BayerPattern computes the Bayer pattern for this palette.

func CheckerPattern added in v1.4.72

func CheckerPattern(size int) []float32

CheckerPattern computes the Bayer-like checkerboard pattern for this palette.

func DiamondPattern added in v1.4.72

func DiamondPattern(size int) []float32

DiamondPattern computes the diamond halftone pattern for this palette.

func EGA added in v1.2.141

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

func HalftonePattern added in v1.4.72

func HalftonePattern(size int) []float32

HalftonePattern computes the Halftone pattern for this palette.

func HybridPattern added in v1.4.72

func HybridPattern(size int) []float32

HybridPattern computes a diamond/halftone hybrid pattern for this palette.

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.

func SquarePattern added in v1.4.72

func SquarePattern(size int) []float32

SquarePattern computes a square pattern for this palette.

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) 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