chromakitx 1.0.2

A comprehensive color manipulation library for Rust
Documentation
// SPDX-FileCopyrightText: 2023 CELESTIFYX Team
// SPDX-License-Identifier: GPL-3.0-or-later

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);
}