Expand description

termcol

Dependency-less library for simple terminal text coloring and formating

Usage

Basic usage (checkout the examples/usage.rs file for more information)

use termcol::*;

fn main() {
    println!("{}red{}", color("red"), color("reset"));
    println!("{}bold{}", format("bold"), format("reset"));
    println!("{}", color_string("im blue", "blue"));
}

LICENSE

This project is distributed under MIT license.

Functions

Function providing a way to disable any form of coloring/formating

Function providing a way to color your cli output

Function providing a way to color your cli output

Function providing a way to format you cli output

Function providing a way to format you cli output

Helper function returning the value of DISALBE_COLORING global variable

Function which optimizes given string from unneded reset control codes

Returns true color escape codes for given u8 values background_or_foreground true => change background background_or_foreground false => change foreground

Returns true color escape codes from given hex string background_or_foreground true => change background background_or_foreground false => change foreground

Returns given string altered with true color escape codes from given u8 values

Returns given string altered with true color escape codes from given hex strings