alexwlchan / dominant_colours

A CLI tool to find the dominant colours in an image 🎨
https://dominant-colours.glitch.me
MIT License
91 stars 4 forks source link

Publish this as a crate that I can reuse from other Rust apps #47

Open alexwlchan opened 3 months ago

alexwlchan commented 3 months ago

Currently the only way to use this tool is through the command-line, which is inefficient for other Rust tools.

It would be nice if it was published as a crate that I could reuse from other apps.

Here's a basic interface:

pub fn find_dominant_colors(path: &PathBuf, max_colors: usize) -> Vec<palette::Lab> { … }

pub fn choose_best_color_for_bg(colors: Vec<palette::Lab>, background: palette:Lab>) -> palette::Lab { … }