#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

#25 in Command-line interface

Download history 20292/week @ 2019-01-20 19783/week @ 2019-01-27 21318/week @ 2019-02-03 23860/week @ 2019-02-10 23874/week @ 2019-02-17 27711/week @ 2019-02-24 26005/week @ 2019-03-03 26999/week @ 2019-03-10 25158/week @ 2019-03-17 23430/week @ 2019-03-24 25782/week @ 2019-03-31 28259/week @ 2019-04-07 24947/week @ 2019-04-14 24284/week @ 2019-04-21 23543/week @ 2019-04-28

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

~555KB