palettes

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyColor

type KeyColor struct {
	// contains filtered or unexported fields
}

KeyColor is a color that represents the hue and chroma of a tonal palette

func NewKeyColor

func NewKeyColor(hue, requestedChroma float64) *KeyColor

NewKeyColor creates a new KeyColor with the given hue and chroma

func (*KeyColor) Create

func (k *KeyColor) Create() color.Hct

Create creates a key color from the hue and chroma The key color is the first tone, starting from T50, matching the given hue and chroma.

Returns an Hct color value

type TonalPalette

type TonalPalette struct {
	Hue      float64
	Chroma   float64
	KeyColor color.Hct
	// contains filtered or unexported fields
}

func FromHueAndChroma

func FromHueAndChroma(hue, chroma float64) *TonalPalette

func NewFromARGB

func NewFromARGB(color color.ARGB) *TonalPalette

func NewFromHct

func NewFromHct(hct color.Hct) *TonalPalette

func (*TonalPalette) Get

func (tp *TonalPalette) Get(tone float64) color.ARGB

func (*TonalPalette) GetHct

func (tp *TonalPalette) GetHct(tone float64) color.Hct

func (*TonalPalette) IsBlue

func (tp *TonalPalette) IsBlue() bool

IsBlue determines if a hue is in the blue range.

func (*TonalPalette) IsCyan

func (tp *TonalPalette) IsCyan() bool

IsCyan determines if a hue is in the cyan range.

func (*TonalPalette) IsYellow

func (tp *TonalPalette) IsYellow() bool

IsYellow determines if a hue is in the yellow range.

func (*TonalPalette) Tone

func (tp *TonalPalette) Tone(tone float64) color.ARGB

Jump to

Keyboard shortcuts

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