Documentation ¶
Index ¶
- type Color
- type HSL
- type HSV
- type Image
- type Palette
- func (p *Palette) AverageColor() *Color
- func (p *Palette) BuildFromHex(colors ...string) (*Palette, error)
- func (p *Palette) BuildFromImage(source Quantizeable) *Palette
- func (p *Palette) Common(p2 *Palette) *Palette
- func (p *Palette) LightColors(limit1, limit2 uint16) *Palette
- func (p *Palette) Quantize(q Quantizer, count uint) *Palette
- func (p *Palette) SortBy(v SortProperty, order bool) *Palette
- func (p *Palette) SortSimilarColors() *Palette
- func (p *Palette) ToHex() []string
- func (p *Palette) Unique() *Palette
- type Quantizeable
- type Quantizer
- type RGB
- type SortProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
func (*Color) Build ¶
Build Color object from rgb values Specify buildAll = true if you want to calculate HSL/HSV values as well
func (*Color) BuildFromHex ¶
Build Color object from Hex string e.g. #FF7913 Specify buildAll = true if you want to calculate HSL/HSV values as well
func (*Color) HueDistance ¶
Calculate Hue distance between two colors
func (*Color) RgbDistance ¶
Calculate RGB distance between two colors
type Image ¶
type Image struct {
FilePath string
}
The Image construct which implements camalian.Quantizeable interface
type Palette ¶
type Palette []*Color
func (*Palette) AverageColor ¶
Calculate avargage color in RGB Color Space for the whole palette
func (*Palette) BuildFromHex ¶
Build color palette from hex strings
new(Palette).BuildFromHex("#FF0000", "#00FF00")
func (*Palette) BuildFromImage ¶
func (p *Palette) BuildFromImage(source Quantizeable) *Palette
Build color palette from a Quantizeable interface
func (*Palette) LightColors ¶
Filter colors in particular range for lightness in HSL color space
func (*Palette) SortBy ¶
func (p *Palette) SortBy(v SortProperty, order bool) *Palette
Sort color palette by some properties
func (*Palette) SortSimilarColors ¶
Sort palette to visually similar colors
type Quantizeable ¶
type Quantizeable interface {
Pixels() []RGB
}
The interface to fetch any quantizeable object
type SortProperty ¶
type SortProperty int
const ( HSLHue SortProperty = iota HSLSaturation HSLLightness HSVHue HSVSaturation HSVValue Red Green Blue )