#coloring #output #template #terminal

output-coloring

Coloring terminal output, using template

1 unstable release

0.1.0 May 22, 2023

#444 in Template engine


Used in hashguard

GPL-3.0 license

15KB
84 lines

output-coloring

Coloring terminal output, using template.

Sample Code

extern crate output_coloring;

use output_coloring::*;

const TEST: ColoredTemplate = ColoredTemplate {
    ft_color: Color::White,
    bg_color: Some(Color::BrightWhite),
    style: Style::Bold,
};
const WARN_TEMPLATE: ColoredTemplate = ColoredTemplate {
    ft_color: Color::White,
    bg_color: Some(Color::Yellow),
    style: Style::Bold,
};

fn main() {
    println!("{}", TEST.output("Hello World!"));
    println!("{}", WARN_TEMPLATE.output(" WARNING! "));
}

No runtime deps