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 ¶
NewKeyColor creates a new KeyColor with the given hue and chroma
type TonalPalette ¶
type TonalPalette struct {
Hue float64
Chroma float64
KeyColor color.Hct
// contains filtered or unexported fields
}
TonalPalette is a convenience type for retrieving colors that are constant in hue and chroma, but vary in tone.
Each TonalPalette is initialized with a hue and chroma, and provides a cache for efficient tone retrieval.
func FromHueAndChroma ¶
func FromHueAndChroma(hue, chroma float64) *TonalPalette
FromHueAndChroma creates a TonalPalette from explicit hue and chroma values.
It internally generates a "key color" that best represents the given hue and chroma, and constructs a tonal palette around it.
func NewFromARGB ¶
func NewFromARGB(c color.ARGB) *TonalPalette
NewFromARGB creates a TonalPalette from an ARGB color.
The palette’s hue and chroma will match those of the provided color, allowing tone values to vary while keeping the same hue and chroma.
func NewFromHct ¶
func NewFromHct(hct color.Hct) *TonalPalette
NewFromHct creates a TonalPalette from a given HCT color.
The resulting palette will have the same hue and chroma as the provided HCT.
func (*TonalPalette) GetHct ¶
func (tp *TonalPalette) GetHct(tone float64) color.Hct
GetHct returns the HCT representation of a color with the specified tone.
This provides access to hue, chroma, and tone values directly in HCT space.
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.