use chromakitx::{
RGB,
AnsiColor,
CustomColor,
helpers::{
colorize,
interpolate_color
}
};
fn display_colors(colors: Vec<RGB>) -> () {
for color in colors {
let formatted: String = colorize("█████", CustomColor::from(color), None::<AnsiColor>);
println!("{} RGB({}, {}, {})", formatted, color.r, color.g, color.b);
}
}
fn main() -> () {
let start: RGB = RGB::new(255, 0, 0);
let end: RGB = RGB::new(0, 0, 255);
println!("Color interpolation from red to blue (10 steps):");
let colors: Vec<RGB> = interpolate_color(&start, &end, 10);
display_colors(colors);
println!("\nInterpolation with 3 steps:");
let colors: Vec<RGB> = interpolate_color(&start, &end, 3);
display_colors(colors);
}