🖍️ Find names of ~2800 colors from a Go package.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
LICENSE
README.md
colors.go
distance.go
distance_test.go
nearest.go
nearest_test.go
palette.go

README.md

chroma Build Status GoDoc Go Report Card GitHub tag license

Find names of ~2800 colors from a Go package.

Inspiration and color data have been sourced from ayushoriginal/Optimized-RGB-To-ColorName


Usage:

// Pick a color close to IBM Blue
blue := color.RGBA{84, 138, 196, 255}

// Find the nearest color
nearest := chroma.NearestColor(blue)

// Print what we got
fmt.Printf("%+v\n", nearest)
&{Color:{Color:{R:90 G:135 B:197 A:255} Names:[IBM Blue]} RGBDistance:{R:6 G:-3 B:1}}

Todo

  • Use faster algorithm for NearestColor()
  • Optimize data structures.

Contributing

Issues/PRs are much appreciated!

Feature requests/improvements welcome.

License

This project is licensed under the MIT License.