Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorePalette ¶
type CorePalette struct { A1 *TonalPalette A2 *TonalPalette A3 *TonalPalette N1 *TonalPalette N2 *TonalPalette Error *TonalPalette }
CorePalette represents a collection of TonalPalettes.
func NewContentCorePaletteFromInt ¶
func NewContentCorePaletteFromInt(argb int) *CorePalette
NewContentCorePaletteFromInt creates content key tones from an ARGB color. for example, NewContentCorePaletteFromInt(0xFF000000) will return a content core palette with black tones. NewContentCorePaletteFromInt(0xFFFF0000) will return a content core palette with red tones.
func NewCorePaletteFromInt ¶
func NewCorePaletteFromInt(argb int) *CorePalette
NewCorePaletteFromInt creates key tones from an ARGB color. for example, NewCorePaletteFromInt(0xFF000000) will return a core palette with black tones. NewCorePaletteFromInt(0xFFFF0000) will return a core palette with red tones.
type TonalPalette ¶
type TonalPalette struct {
// contains filtered or unexported fields
}
func NewTonalPaletteFromHct ¶
func NewTonalPaletteFromHct(hct *hct.Hct) *TonalPalette
NewTonalPaletteFromHct creates a TonalPalette from an Hct.
func NewTonalPaletteFromHueChroma ¶
func NewTonalPaletteFromHueChroma(hue, chroma float64) *TonalPalette
NewTonalPaletteFromHueChroma creates a TonalPalette from a hue and chroma.
func NewTonalPaletteFromInt ¶
func NewTonalPaletteFromInt(argb int) *TonalPalette
NewTonalPaletteFromInt creates a TonalPalette from an ARGB color. for example, NewTonalPaletteFromInt(0xFF000000) will return a TonalPalette with black tones. NewTonalPaletteFromInt(0xFFFF0000) will return a TonalPalette with red tones.
func (*TonalPalette) GetChroma ¶
func (tp *TonalPalette) GetChroma() float64
GetChroma returns the chroma of the TonalPalette.
func (*TonalPalette) GetHct ¶
func (tp *TonalPalette) GetHct(tone float64) *hct.Hct
GetHct returns the HCT color with the specified tone.
func (*TonalPalette) GetHue ¶
func (tp *TonalPalette) GetHue() float64
GetHue returns the hue of the TonalPalette.
func (*TonalPalette) GetKeyColor ¶
func (tp *TonalPalette) GetKeyColor() *hct.Hct
GetKeyColor returns the key color of the TonalPalette.
func (*TonalPalette) Tone ¶
func (tp *TonalPalette) Tone(tone int) int
Tone returns an ARGB color with the HCT hue and chroma of the TonalPalette and the provided tone.