minimal_ansi_color

Crates.iominimal_ansi_color
lib.rsminimal_ansi_color
version0.1.0
sourcesrc
created_at2024-10-29 15:04:02.033541
updated_at2024-10-29 15:04:02.033541
descriptionAnsi Color
homepage
repositoryhttps://github.com/Thomas-Mewily/ansi_color
max_upload_size
id1427114
size7,001
Thomas Mewily (Thomas-Mewily)

documentation

README

A minimal package for printing some Ansi Color

use minimal_ansi_color::*;

println!("{}I'm green{}", AnsiColor::GREEN_FOREGROUND, AnsiColor::RESET);
println!("{}I'm red{}", AnsiColor::new_foreground(AnsiColorKind::Red), AnsiColor::RESET);
println!("{}White on magenta background{}", AnsiColor::new(AnsiColorKind::Magenta, AnsiColorLayer::Background), AnsiColor::RESET);
pub enum AnsiColorKind
{
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
    Grey,
}

pub enum AnsiColorLayer 
{
    Foreground,
    Background,
}

pub struct AnsiColor
{
    pub color : AnsiColorKind,
    pub layer : AnsiColorLayer,
}
Commit count: 4

cargo fmt