rainbow-text

Crates.iorainbow-text
lib.rsrainbow-text
version0.1.5
sourcesrc
created_at2020-11-15 10:58:20.016446
updated_at2020-11-17 10:10:08.07314
descriptionWrite text in rainbow colors
homepage
repositoryhttps://github.com/rishit-khandelwal/rainbow
max_upload_size
id312544
size5,249
rk (rk31415926535)

documentation

README

Rainbow

A 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();
    
    rain.write("Hello, World")?;
    
    Ok(())
}

Write text with background colors

use rainbow_text::Rainbow;

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

Custom Rainbows!

use rainbow_text::{ Rainbow, Color };

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

cargo fmt