colory

Crates.iocolory
lib.rscolory
version0.5.0
sourcesrc
created_at2020-08-01 08:55:47.314713
updated_at2021-01-10 14:21:41.190967
descriptionA simple library to make your command line application more colorful!
homepagehttps://github.com/CoolDeveloper101/colory
repositoryhttps://github.com/CoolDeveloper101/colory
max_upload_size
id271894
size33,095
(CoolDeveloper101)

documentation

https://docs.rs/colory

README

Colory

build

A simple library to make your command line application more colorful!

Getting Started

To use colory in your project, add it to the dependencies section in you Cargo.toml

[dependencies]
colory = "0.5.0"

This will allow Cargo to download, build, and cache the colory as a package directly from crates.io.

use colory::{ForegroundColor as fg, colory_init};

fn main() {
    colory_init(); // required to call this on windows. It will do nothing on *nix systems.
    println!("{}Hello, world!{}", fg::Green, fg::Normal);
}

For more complex examples, see the examples directory.

Platform Support

Here is a list of prominent terminal emulators that support ansi escape codes(this list is not complete, contribute by opening an issue or a pull request) -

Unix Like

  • Linux console
  • GNU Screen
  • Minicorn
  • tmux

macOs

  • Terminal
  • iTerm2
  • xterm

Microsoft Windows

  • AlphaCom
  • ConEmu
  • mintty
  • PuTTy
  • Windows Terminal
  • Windows Console (aka cmd)
  • Powershell

If you terminal emulator is not in the list, download this library and run some of the examples. If they do not work, then your terminal probably does not support it.

Note: This library may not work with terminals that do not support ansi escape codes.

Commit count: 53

cargo fmt