15 lines
308 B
Rust
15 lines
308 B
Rust
mod palette;
|
|
|
|
fn main() {
|
|
let image = image::open("image.png")
|
|
.expect("Failed to open image");
|
|
|
|
let colors = palette::Palette::generate(image);
|
|
|
|
println!("Dominant color: {:?}", colors.dominant_color());
|
|
println!("All colors:");
|
|
for color in &colors.raw_colors {
|
|
println!("\t{:?}", color);
|
|
}
|
|
}
|