| Crates.io | hexga_ansi_color |
| lib.rs | hexga_ansi_color |
| version | 0.0.11-beta.3 |
| created_at | 2025-05-17 23:03:31.461408+00 |
| updated_at | 2025-08-12 19:07:33.217223+00 |
| description | Ansi Color |
| homepage | https://github.com/Thomas-Mewily/hexga |
| repository | https://github.com/Thomas-Mewily/hexga |
| max_upload_size | |
| id | 1678220 |
| size | 11,804 |
A minimal package for using the Ansi Color :
Provides optional support for Serde (serialization / deserialization) when the "serde" feature is enabled.
use hexga_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,
}
Based on minimal_ansi_color, but integrated to hexga.
Check hexga : https://crates.io/crates/hexga if you are interested in a quick start, it regroup multiple hexga crates.