diff options
author | Devon Sawatsky <novedevo@gmail.com> | 2021-09-27 19:16:53 -0700 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2021-09-28 23:05:18 +0000 |
commit | a7b99f4f205531f7f8a793af1e6d53445bf718ad (patch) | |
tree | 678ff5eaa786781a329e6712763611796b3d19bf /src | |
parent | 711a26d0690ec9ca4cc93ecc864b8fe65785e14e (diff) | |
download | colorsquash-a7b99f4f205531f7f8a793af1e6d53445bf718ad.tar.gz colorsquash-a7b99f4f205531f7f8a793af1e6d53445bf718ad.zip |
cleanup, update dependencies
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 9513a62..eda43c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,12 @@ -use std::{cmp::Ordering, collections::HashMap, env::args, time::Instant}; +use std::{collections::HashMap, env::args, time::Instant}; use image::io::Reader as ImageReader; use image::Rgb; fn main() { let before = Instant::now(); - let filename = std::env::args().skip(1).next().unwrap(); - let outname = std::env::args().skip(2).next().unwrap(); + let filename = args().nth(1).unwrap(); + let outname = args().nth(2).unwrap(); // The percent of RGB value difference a color has to surpass to be considere unique let tolerance = 0.6; let rgb_tolerance = 10.0 * tolerance; @@ -149,6 +149,7 @@ fn rgb_difference(a: &Rgb<u8>, z: &Rgb<u8>) -> f64 { (((c - f) * (c - f)) + ((a - d).abs() / 90.0) + (b - e).abs()) as f64 } +#[warn(clippy::float_cmp)] fn pixel_rgb_to_hsv(a: &Rgb<u8>) -> (f32, f32, f32) { let (r, g, b) = ( a.0[0] as f32 / 256.0, |