charmtone

package module
v0.0.0-...-64e30b5 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 5 Imported by: 12

Documentation

Overview

Package charmtone contains an API for the CharmTone color palette.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blend

func Blend(size int, keys ...Key) []color.Color

Blend returns a slice of colors blended between the given Keys. Blending is done as Hcl to stay in gamut.

Types

type Key

type Key int

Key is a type for color keys.

const (
	Cumin Key = iota
	Tang
	Yam
	Paprika
	Bengal
	Uni
	Sriracha
	Coral
	Salmon
	Chili
	Cherry
	Tuna
	Macaron
	Pony
	Cheeky
	Flamingo
	Dolly
	Blush
	Urchin
	Mochi
	Lilac
	Prince
	Violet
	Mauve
	Grape
	Plum
	Orchid
	Jelly
	Charple
	Hazy
	Ox
	Sapphire
	Guppy
	Oceania
	Thunder
	Anchovy
	Damson
	Malibu
	Sardine
	Zinc
	Turtle
	Lichen
	Guac
	Julep
	Bok
	Mustard
	Citron
	Zest
	Pepper
	BBQ
	Charcoal
	Iron
	Oyster
	Squid
	Smoke
	Ash
	Salt
	Butter

	// Diffs: additions. The brightest color in this set is Julep, defined
	// above.
	Pickle
	Gator
	Spinach

	// Diffs: deletions. The brightest color in this set is Cherry, defined
	// above.
	Pom
	Steak
	Toast

	// Provisional.
	NeueGuac
	NeueZinc
)

Available colors.

func Keys

func Keys() []Key

Keys returns a slice of all CharmTone color keys.

func (Key) Hex

func (k Key) Hex() string

Hex returns the hex value of the color.

func (Key) IsPrimary

func (k Key) IsPrimary() bool

IsPrimary indicates which colors are part of the core palette.

func (Key) IsSecondary

func (k Key) IsSecondary() bool

IsSecondary indicates which colors are part of the secondary palette.

func (Key) IsTertiary

func (k Key) IsTertiary() bool

IsTertiary indicates which colors are part of the tertiary palette.

func (Key) RGBA

func (k Key) RGBA() (r, g, b, a uint32)

RGBA returns the red, green, blue, and alpha values of the color. It satisfies the color.Color interface.

func (Key) String

func (k Key) String() string

String returns the official CharmTone name of the color. It satisfies the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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