1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/wincolor
2018-02-11 13:38:00 -05:00
..
src termcolor: support ANSI in Windows terminals 2018-02-10 22:28:12 -05:00
Cargo.toml wincolor: release 0.1.6 2018-02-11 13:38:00 -05:00
COPYING Add license files to each crate. 2017-03-12 16:57:15 -04:00
LICENSE-MIT Add license files to each crate. 2017-03-12 16:57:15 -04:00
README.md Completely re-work colored output and tty handling. 2016-11-20 11:14:52 -05:00
UNLICENSE Add license files to each crate. 2017-03-12 16:57:15 -04:00

wincolor

A simple Windows specific API for controlling text color in a Windows console. The purpose of this crate is to expose the full inflexibility of the Windows console without any platform independent abstraction.

Windows build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/wincolor

Usage

Add this to your Cargo.toml:

[dependencies]
wincolor = "0.1"

and this to your crate root:

extern crate wincolor;

Example

This is a simple example that shows how to write text with a foreground color of cyan and the intense attribute set:

use wincolor::{Console, Color, Intense};

let mut con = Console::stdout().unwrap();
con.fg(Intense::Yes, Color::Cyan).unwrap();
println!("This text will be intense cyan.");
con.reset().unwrap();
println!("This text will be normal.");