Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
/ color-thief-rs Public archive

Grabs the dominant color or a representative color palette from an image.

License

Notifications You must be signed in to change notification settings

RazrFalcon/color-thief-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

color-thief-rs

color-thief-rs is a color-thief algorithm reimplementation in Rust.

The implementation itself is a heavily modified Swift version of the same algorithm.

Differences

  • There is no getColor method, since it's just a shorthand for getPalette.
  • Output colors are a bit different from JS version. See tests for details.

Performance

About 150x faster that JS version.

test q1  ... bench:   1,429,800 ns/iter (+/- 21,987)
test q10 ... bench:     854,297 ns/iter (+/- 25,468)

Usage

Dependency: Rust >= 1.13

Add this to your Cargo.toml:

[dependencies]
color-thief = "0.2"

License

color-thief-rs is licensed under the MIT.

About

Grabs the dominant color or a representative color palette from an image.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages