material

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoColorFound = errors.New("no color found")

ErrNoColorFound is a error

View Source
var GeneratorFlags = pflag.NewFlagSet("generate", pflag.ContinueOnError)

GeneratorFlags are the flags used for generating colors

Functions

func GetPixelsFromImage

func GetPixelsFromImage(img image.Image) []color.ARGB

GetPixelsFromImage returns pixels from image.Imaget interface

Types

type Colors

type Colors = map[string]color.ARGB

Colors is key and color

func GenerateFromImage

func GenerateFromImage(img image.Image, cfg Config) (Colors, []color.ARGB, error)

GenerateFromImage colors from an image.Image

func GenerateFromPixels

func GenerateFromPixels(pixels []color.ARGB, cfg Config) (Colors, []color.ARGB, error)

GenerateFromPixels generates color from a slice of pixels

func GenerateFromQuantized

func GenerateFromQuantized(quantized Quantized, cfg Config) (Colors, []color.ARGB, error)

GenerateFromQuantized generates color from a cached quantized

type Config

type Config struct {
	Variant   dynamic.Variant
	Platform  dynamic.Platform
	Version   dynamic.Version
	Dark      bool
	Constrast float64
}

Config is configuration used to generate colors

func GetConfig

func GetConfig() (Config, error)

GetConfig return Config from viper

type Quantized

type Quantized struct {
	Celebi map[color.ARGB]int `json:"celebi"`
	Wu     []color.ARGB       `json:"wu"`
}

Quantized is quantized colors

func Quantize

func Quantize(pixels []color.ARGB) Quantized

Quantize quantizes list of pixels

Jump to

Keyboard shortcuts

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