#windows #win #color #ansi #console

wincolor

A simple Windows specific API for controlling text color in a Windows console

9 releases (2 stable)

1.0.1 Aug 25, 2018
1.0.0 Jul 17, 2018
0.1.6 Feb 11, 2018
0.1.4 Jun 19, 2017
0.1.0 Nov 20, 2016

#2 in Command-line interface

Download history 19628/week @ 2018-10-06 18252/week @ 2018-10-13 17467/week @ 2018-10-20 19765/week @ 2018-10-27 18146/week @ 2018-11-03 19361/week @ 2018-11-10 17286/week @ 2018-11-17 17995/week @ 2018-11-24 22144/week @ 2018-12-01 22409/week @ 2018-12-08 19252/week @ 2018-12-15 14412/week @ 2018-12-22 14793/week @ 2018-12-29 18801/week @ 2019-01-05 20257/week @ 2019-01-12

65,116 downloads per month
Used in 915 crates (2 directly)

Unlicense/MIT

11KB
194 lines

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

Dependencies

~547KB