colorthief

package module
v0.0.0-...-f393563 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 8 Imported by: 5 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Color Thief (Golang)

Grab the color palette from an image.

Download

go get -u github.com/cascax/colorthief-go

Usage

import "github.com/cascax/colorthief-go"

colors, err := colorthief.GetPaletteFromFile("img/image-1.png", 6)

baseColor, err := colorthief.GetColorFromFile("img/image-1.png")

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxCubes = 6

Functions

func GetColor

func GetColor(img image.Image) (color.Color, error)

GetColor return the base color from the image

func GetColorFromFile

func GetColorFromFile(imgPath string) (color.Color, error)

GetColorFromFile return the base color from the image file

func GetPalette

func GetPalette(img image.Image, maxCubes int) ([]color.Color, error)

GetPalette return cluster similar colors by the median cut algorithm

func GetPaletteFromFile

func GetPaletteFromFile(imgPath string, maxCubes int) ([]color.Color, error)

GetPaletteFromFile return cluster similar colors from the image file

func PrintColor

func PrintColor(colors []color.Color, filename string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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