hexga_ansi_color

Crates.iohexga_ansi_color
lib.rshexga_ansi_color
version0.0.11-beta.3
created_at2025-05-17 23:03:31.461408+00
updated_at2025-08-12 19:07:33.217223+00
descriptionAnsi Color
homepagehttps://github.com/Thomas-Mewily/hexga
repositoryhttps://github.com/Thomas-Mewily/hexga
max_upload_size
id1678220
size11,804
Mewily (Thomas-Mewily)

documentation

README

HexGa Ansi Color

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);

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,
}

Based on minimal_ansi_color, but integrated to hexga.

Main Hexga crate

Check hexga : https://crates.io/crates/hexga if you are interested in a quick start, it regroup multiple hexga crates.

Commit count: 338

cargo fmt