rainbow-text 0.1.3

Write text in rainbow colors
Documentation

Rainbow

A simple cross platform crate for writing text in rainbow colors.

Examples

Write text with foreground colors

use rainbow_text::Rainbow;

fn main() -> std::io::Result<()>
{
    let rain = Rainbow::default("Hello, World");
    
    rain.write()?;
    
    Ok(())
}

Write text with background colors

use rainbow_text::Rainbow;

fn main() -> std::io::Result<()>
{
    let rain = Rainbow::default("Hello, World");
    
    rain.write_bg()?;
    
    Ok(())
}

Change the text

use rainbow_text::Rainbow;

fn main() -> std::io::Result<()>
{
    let mut rain = Rainbow::default("Hello, World");
    
    rain.write()?;
    rain.change_text("Rainbows!");
    rain.write()?;
    
    Ok(())
}

Custom Rainbows!

use rainbow_text::{ Rainbow, Color };

fn main() -> std::io::Result<()>
{
    let rain = Rainbow::custom(
        "Hello, World",
        vec![
            Color::Rgb(255,0,0),
            Color::Rgb(0,255,0),
            Color::Rgb(0,0,255),
        ]
    );
    
    rain.write()?;
    
    Ok(())
}