Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Palette_ColorNames12 = map[string]string{
"#000000": "Black",
"#ffffff": "White",
"#808080": "Gray",
"#c41414": "Red",
"#00ff00": "Green Lime",
"#2874E6": "Blue",
"#FFFF00": "Yellow",
"#FF681F": "Orange",
"#9d3909": "Brown",
"#BAE9F3": "Light Blue",
"#FF00FF": "Pink",
"#DAFC4F": "Canary",
"#228B22": "Green",
"#881e88": "Purple",
}
Palette_ColorNames12 - Main 12 colors
var Palette_ColorNames26 = map[string]string{
"#000000": "Black",
"#FFFFFF": "White",
"#808080": "Gray",
"#0000FF": "Blue",
"#2874E6": "Royal Blue",
"#BAE9F3": "Light Blue",
"#808000": "Olive",
"#A7C261": "Celery",
"#008000": "Green",
"#00FF00": "Lime Green",
"#DAFC4F": "Canary",
"#F0E891": "Khaki",
"#8e1c1c": "Maroon",
"#B44848": "Chestnut",
"#B5651D": "Brown",
"#CC8454": "Raw Sienna",
"#FDD9B5": "Apricot",
"#800080": "Purple",
"#6658B6": "Blue Violet",
"#C285DB": "Lavender",
"#FF00FF": "Pink",
"#FFAACC": "Carnation Pink",
"#DA3163": "Cerise Red",
"#FF0000": "Red",
"#FF4800": "Red Orange",
"#FF681F": "Orange",
"#FF9900": "Yellow Orange",
"#FFCC00": "Golden Yellow",
"#FFFF00": "Yellow",
}
Palette_ColorNames26 - Main 26 colors
var Palette_ColorNames3 = map[string]string{
"#000000": "Black",
"#ffffff": "White",
"#c41414": "Red",
"#228B22": "Green",
"#2874E6": "Blue",
}
Palette_ColorNames3 - Main 3 colors
var Palette_ColorNamesMAX = map[string]string{}/* 1566 elements not displayed */
Palette_ColorNamesMAX - Colors with all names
var Palette_Default = Palette_ColorNames12
Palette_Default - default color map
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection of color lists
func NewCollection ¶
func NewCollection(im *Image) *Collection
NewCollection - Collection and initialize lists
func (*Collection) CollectStats ¶
func (col *Collection) CollectStats()
CollectStats - trigger stats gathering from lists
func (*Collection) Find ¶
func (col *Collection) Find(c *Color) *Color
Find - find color by given color can be used to chekc if color already exists
type Color ¶
type Color struct { Count int // color px count on image Percents float64 ColorfulColor colorful.Color Name string // color name NameHex string // exact color hex // contains filtered or unexported fields }
Color - coloris color type
func DominantColor ¶
DominantColor - get one color that are mostly used If two color on same count use first as comes
type ColorList ¶
type ColorList []*Color
ColorList - color list of colors
func BytesToAllColors ¶
BytesToAllColors - Return all collected colors from bytes
func (*ColorList) FindByName ¶
FindByName - is already exists in list
type Image ¶
type Image struct { Palette map[string]string // use these colors to detect color names SkipColors []string Collection *Collection // contains filtered or unexported fields }
Image data
func NewImageFromBytes ¶
NewImageFromBytes - load and process image
func (*Image) DominantColor ¶
DominantColor - get one color that are mostly used If two color on same count use first as comes
func (*Image) ProcessBytes ¶
ProcessBytes - from bytes