| Crates.io | minimal_ansi_color |
| lib.rs | minimal_ansi_color |
| version | 0.2.0 |
| created_at | 2024-10-29 15:04:02.033541+00 |
| updated_at | 2024-12-19 10:36:50.082499+00 |
| description | Ansi Color |
| homepage | |
| repository | https://github.com/Thomas-Mewily/ansi_color |
| max_upload_size | |
| id | 1427114 |
| size | 8,471 |
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);
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,
}