huecolors

package
v0.0.0-...-b94e874 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIExyY

type CIExyY struct {
	X         float64
	Y         float64
	Luminance float64
}

CIExyY represents a color in the CIE xyY colorspace

func GetHueColors

func GetHueColors(nbColors int, imgData []byte) (colors []CIExyY, params string, err error)

GetHueColors returns the x (nbColors) main colors from imgData (jpg or png)

type ColorSet

type ColorSet struct {
	// contains filtered or unexported fields
}

ColorSet is a collection of colors holding metadata like: prominentcolor parameters used to create the set in int and str format, total distance between each colors (diversity) and the colors theirself in colorful format allowing all type of conversions.

func NewColorSet

func NewColorSet(set []prominentcolor.ColorItem, params int) ColorSet

NewColorSet create a metadata rich colorset from a prominentcolor set

func (ColorSet) GetColorfullSet

func (cs ColorSet) GetColorfullSet() []colorful.Color

GetColorfullSet returns the set in the colorful format

func (ColorSet) GetPColorParams

func (cs ColorSet) GetPColorParams() int

GetPColorParams returns the prominentcolor params used to generate the set

func (ColorSet) GetPColorParamsString

func (cs ColorSet) GetPColorParamsString() string

GetPColorParamsString returns the string format of prominentcolor params used to generate the set

func (ColorSet) GetPColorSet

func (cs ColorSet) GetPColorSet() (pcolorSet []prominentcolor.ColorItem)

GetPColorSet rebuild a prominentcolor compatible set (minus the cnt metadata which has been lost)

func (ColorSet) TotalDistance

func (cs ColorSet) TotalDistance() float64

TotalDistance returns the total distance between every colors within the set

type ColorSets

type ColorSets []ColorSet

ColorSets is a collection of ColorSet sortable on their distance

func (ColorSets) Len

func (cs ColorSets) Len() int

func (ColorSets) Less

func (cs ColorSets) Less(i, j int) bool

func (ColorSets) Swap

func (cs ColorSets) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL