Documentation ¶
Index ¶
- func Analogous(c color.Color) []color.Color
- func Blends(c1, c2 color.Color, count int) []color.Color
- func Complementary(c color.Color) color.Color
- func Contrast(c color.Color) color.Color
- func Cool(c color.Color) bool
- func Darker(c color.Color, percent float64) color.Color
- func Generate(count int, generator ColorGenerator) ([]color.Color, error)
- func Hex(s string) color.Color
- func HueOffset(c color.Color, degrees int) color.Color
- func Lighter(c color.Color, percent float64) color.Color
- func Monochromatic(c color.Color, count int) []color.Color
- func Quadratic(c color.Color) []color.Color
- func Shades(c color.Color, count int) []color.Color
- func SplitComplementary(c color.Color) []color.Color
- func Tetradic(c1 color.Color, c2 color.Color) []color.Color
- func Tints(c color.Color, count int) []color.Color
- func ToHex(c color.Color) string
- func Tones(c color.Color, count int) []color.Color
- func Triadic(c color.Color) []color.Color
- func Warm(c color.Color) bool
- type BroadGranularity
- type Color
- type ColorGenerator
- type ColorObservation
- type Colors
- type FineGranularity
- type HappyGenerator
- type Palette
- func (g *Palette) AddColors(cc Colors)
- func (g Palette) Clamped(cc []color.Color) Colors
- func (g Palette) Color(name string) (color.Color, bool)
- func (g Palette) Colors() Colors
- func (g Palette) Filter(name string) Colors
- func (g Palette) MixedWith(p Palette) Palette
- func (g Palette) Name(color color.Color) (Colors, float64)
- type PastelGenerator
- type SimilarHueGenerator
- type WarmGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Complementary ¶
Complementary returns the complementary value for any given color
func Generate ¶
func Generate(count int, generator ColorGenerator) ([]color.Color, error)
Generate returns a slice with the requested amount of colors, generated by the provided ColorGenerator.
func Monochromatic ¶
Monochromatic returns the specified amount of monochromatic colors based on a given color's hues
func SplitComplementary ¶
SplitComplementary returns the split complementary values for any given color
Types ¶
type BroadGranularity ¶
type BroadGranularity struct { }
BroadGranularity is used for wider color spaces, e.g. by the PastelGenerator
func (BroadGranularity) Granularity ¶
func (g BroadGranularity) Granularity() (l, c float64)
Granularity returns BroadGranularity's default values
type ColorGenerator ¶
A ColorGenerator checks whether a point in the three dimensional CIELab space is suitable for color generation.
type ColorObservation ¶
ColorObservation is a wrapper around colorful.Color, implementing the clusters.Observation interface
func (ColorObservation) Coordinates ¶
func (c ColorObservation) Coordinates() clusters.Coordinates
Coordinates returns the data points of a Lab color value
func (ColorObservation) Distance ¶
func (c ColorObservation) Distance(pos clusters.Coordinates) float64
Distance calculates the distance between two ColorObservations in the Lab color space
type FineGranularity ¶
type FineGranularity struct { }
FineGranularity is used for tighter color spaces, e.g. by the SimilarHueGenerator
func (FineGranularity) Granularity ¶
func (g FineGranularity) Granularity() (l, c float64)
Granularity returns FineGranularity's default values
type HappyGenerator ¶
type HappyGenerator struct {
BroadGranularity
}
HappyGenerator produces "happy" colors
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
A Palette is a collection of colors
func (Palette) Clamped ¶
Clamped expects a slice of colors and returns a slice of the nearest matching colors from the palette
type PastelGenerator ¶
type PastelGenerator struct {
BroadGranularity
}
PastelGenerator produces "pastel" colors
type SimilarHueGenerator ¶
type SimilarHueGenerator struct { FineGranularity Color color.Color }
SimilarHueGenerator produces colors with a similar hue as the given color
type WarmGenerator ¶
type WarmGenerator struct {
BroadGranularity
}
WarmGenerator produces "warm" colors