minimal_ansi_color

Crates.iominimal_ansi_color
lib.rsminimal_ansi_color
version0.2.0
created_at2024-10-29 15:04:02.033541+00
updated_at2024-12-19 10:36:50.082499+00
descriptionAnsi Color
homepage
repositoryhttps://github.com/Thomas-Mewily/ansi_color
max_upload_size
id1427114
size8,471
Mewily (Thomas-Mewily)

documentation

README

A minimal package for using the Ansi Color :

Provides optional support for Serde (serialization / deserialization) when the "serde" feature is enabled.

use minimal_ansi_color::*;

println!("{}I'm green{}", AnsiColor::GREEN, 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);

image

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: 10

cargo fmt