palette

package
v0.0.0-...-95e8317 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package palette implements useful color.Palette operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(img draw.Image, p color.Palette)

Apply updates the image to only use colors from the palette. The alpha channel is always left untouched.

If the palette is empty, the image is not modified.

func ApplyN

func ApplyN(img draw.Image, n int)

ApplyN is shorthand for Apply(img, New(img, n)).

func New

func New(img image.Image, n int) color.Palette

New creates a palette of up to n colors from the image. All colors in the palette are fully opaque.

If n < 1, the palette is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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