Crates.io | minimal_ansi_color |
lib.rs | minimal_ansi_color |
version | 0.1.0 |
source | src |
created_at | 2024-10-29 15:04:02.033541 |
updated_at | 2024-10-29 15:04:02.033541 |
description | Ansi Color |
homepage | |
repository | https://github.com/Thomas-Mewily/ansi_color |
max_upload_size | |
id | 1427114 |
size | 7,001 |
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,
}