Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor represents the color palette extractor instance associated with a single image.
func NewExtractor ¶
NewExtractor returns a new instance of an Extractor. The provider filename parameter can contain a path, and must include the file extension. The provided quality parameter behaves in the following manner: the bigger the number, the faster a color will be returned but the greater the likelihood that it will not be the visually most dominant color. 1 then refers the highest quality.
func NewPNGImageExtractor ¶
NewPNGImageExtractor ...
func (*Extractor) GetColor ¶
GetColor selects the dominant color. It corresponds to the first color in the palette. The color is returned as [r g b].
func (*Extractor) GetNumberOfColor ¶
GetNumberOfColor ...
func (*Extractor) GetPalette ¶
GetPalette builds a color palette. We are using the median cut algorithm to cluster similar colors. The provided count parameter defines how many colors should be extracted. Each color is returned as [r g b].