colorx

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

README

ColorX

ColorX is a library to determine the most prominent color in an image. ColorX doesn't use any sort of complex algorithms to calculate the prominent color, it simply loops over the image pixels and returns the color that occurs the most.

The getProminentColor function returns the color in 2 formats, a hex string such as: #abfecd and a variable of type color.Color.

Example

An example on how to use this library is written in example/example.go

Supported Image Formats

Currently ColorX supports these image formats:

  • png
  • jpeg
  • webp
  • gif

Documentation

Index

Constants

View Source
const MAX_PIXELS = 20000

Variables

This section is empty.

Functions

func GetProminentColor

func GetProminentColor(data []byte) (string, color.Color, error)

GetProminentColor gets the most prominent color in the image bytes reader that gets passed in. returns a hex color as a string.

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