Documentation ¶
Index ¶
- func BayerPattern(size int) []float32
- func CheckerPattern(size int) []float32
- func DiamondPattern(size int) []float32
- func EGA(i EGAIndex, a uint8) color.NRGBA
- func HalftonePattern(size int) []float32
- func HybridPattern(size int) []float32
- func Names() []string
- func Parse(s string, name string) (color.NRGBA, error)
- func SaveCachedLUTs(w, h int, dir string) error
- func SetCurrent(pal *Palette, doRemap bool) bool
- func SquarePattern(size int) []float32
- type EGAIndex
- type Palette
- func (p *Palette) ApplyToImage(img image.Image, name string) image.Image
- func (p *Palette) ApplyToNRGBA(col color.NRGBA, name string) color.NRGBA
- func (p *Palette) ApplyToRGBA(col color.RGBA, name string) color.RGBA
- func (p *Palette) ToLUT(bounds image.Rectangle, numLUTs int) (image.Image, int, int, int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BayerPattern ¶ added in v1.4.72
BayerPattern computes the Bayer pattern for this palette.
func CheckerPattern ¶ added in v1.4.72
CheckerPattern computes the Bayer-like checkerboard pattern for this palette.
func DiamondPattern ¶ added in v1.4.72
DiamondPattern computes the diamond halftone pattern for this palette.
func HalftonePattern ¶ added in v1.4.72
HalftonePattern computes the Halftone pattern for this palette.
func HybridPattern ¶ added in v1.4.72
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 SaveCachedLUTs ¶ added in v1.2.164
func SetCurrent ¶ added in v1.2.141
SetCurrent changes the current palette. Returns whether the remapping table changed.
func SquarePattern ¶ added in v1.4.72
SquarePattern computes a square pattern for this palette.
Types ¶
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
Palette encapsulates a color palette.
func (*Palette) ApplyToImage ¶ added in v1.2.141
ApplyToImage applies this palette's associated color remapping to an image.
func (*Palette) ApplyToNRGBA ¶ added in v1.2.141
ApplyToNRGBA applies this palette's associated col remapping to a single col.
func (*Palette) ApplyToRGBA ¶ added in v1.2.141
ApplyToRGBA applies this palette's associated col remapping to a single col.