#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 21339/week @ 2018-09-10 26312/week @ 2018-09-17 23361/week @ 2018-09-24 19788/week @ 2018-10-01 21272/week @ 2018-10-08 18914/week @ 2018-10-15 16995/week @ 2018-10-22 19450/week @ 2018-10-29 18914/week @ 2018-11-05 18476/week @ 2018-11-12 18928/week @ 2018-11-19 17067/week @ 2018-11-26 16569/week @ 2018-12-03

65,116 downloads per month
Used in 744 crates (1 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

~562KB