use deltae::*; use std::error::Error; mod cli; fn main() -> Result<(), Box> { //Parse command line arguments with clap let matches = cli::command().get_matches(); let method = matches.get_one::("METHOD").unwrap().to_owned(); let color_type = matches.get_one::("COLORTYPE").unwrap(); let color0 = matches.get_one::("REFERENCE").unwrap(); let color1 = matches.get_one::("SAMPLE").unwrap(); let delta = match color_type.as_str() { "lab" => color0.parse::()?.delta(color1.parse::()?, method), "lch" => color0.parse::()?.delta(color1.parse::()?, method), "xyz" => color0.parse::()?.delta(color1.parse::()?, method), _ => unreachable!("COLORTYPE"), }; println!("{}: {}", delta.method(), delta.value()); Ok(()) }