base16

package
v5.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectColors

func SelectColors(colors []color.Hct, k int) []color.Hct

SelectColors selects k Hct colors maximizing angular separation.

Types

type Base16

type Base16 struct {
	Black, BrightBlack     color.ARGB
	Red, BrightRed         color.ARGB
	Green, BrightGreen     color.ARGB
	Yellow, BrightYellow   color.ARGB
	Blue, BrightBlue       color.ARGB
	Magenta, BrightMagenta color.ARGB
	Cyan, BrightCyan       color.ARGB
	White, BrightWhite     color.ARGB
	// contains filtered or unexported fields
}

Base16 is the generated output.

func Generate

func Generate(
	material map[string]color.ARGB,
	quantized material.Quantized,
) Base16

Generate generates colors from material color name and quantized colors.

func GenerateDynamic

func GenerateDynamic(
	fg, bg color.ARGB,
	colors []color.ARGB,
) Base16

GenerateDynamic generates base16 colors from selecting quantizes color. It takes color with long chroma distance to ensure colors has more variety.

func GenerateStatic

func GenerateStatic(primary color.ARGB, wu []color.ARGB) Base16

GenerateStatic generates base16 colors from pre-defined colors.

func NewBase16

func NewBase16() Base16

NewBase16 creates a new Base16.

func (*Base16) SetBlack

func (b *Base16) SetBlack(c color.Hct)

SetBlack sets the Black and Bright Black color.

func (*Base16) SetBlue

func (b *Base16) SetBlue(c color.Hct)

SetBlue sets the Blue and Bright Blue color.

func (*Base16) SetCyan

func (b *Base16) SetCyan(c color.Hct)

SetCyan sets the Cyan and Bright Cyan color.

func (*Base16) SetGreen

func (b *Base16) SetGreen(c color.Hct)

SetGreen sets the Green and Bright Green color.

func (*Base16) SetMagenta

func (b *Base16) SetMagenta(c color.Hct)

SetMagenta sets the Magenta and Bright Magenta color.

func (*Base16) SetRed

func (b *Base16) SetRed(c color.Hct)

SetRed sets the Red and Bright Red color.

func (*Base16) SetWhite

func (b *Base16) SetWhite(c color.Hct)

SetWhite sets the White and Bright White color.

func (*Base16) SetYellow

func (b *Base16) SetYellow(c color.Hct)

SetYellow sets the Yellow and Bright Yellow color.

Jump to

Keyboard shortcuts

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