#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

#3 in Command-line interface

Download history 12413/week @ 2018-07-20 12738/week @ 2018-07-27 21023/week @ 2018-08-03 23207/week @ 2018-08-10 20465/week @ 2018-08-17 19628/week @ 2018-08-24 21752/week @ 2018-08-31 19787/week @ 2018-09-07 27757/week @ 2018-09-14 24764/week @ 2018-09-21 20343/week @ 2018-09-28 21693/week @ 2018-10-05 18588/week @ 2018-10-12

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

~576KB