11 releases (4 stable)

Uses old Rust 2015

1.0.3 Jan 11, 2020
1.0.2 Aug 16, 2019
1.0.1 Aug 25, 2018
1.0.0 Jul 17, 2018
0.1.0 Nov 20, 2016

#72 in #ansi

Download history 2666/week @ 2022-01-25 2666/week @ 2022-02-01 2419/week @ 2022-02-08 2305/week @ 2022-02-15 2574/week @ 2022-02-22 2387/week @ 2022-03-01 4012/week @ 2022-03-08 3060/week @ 2022-03-15 2507/week @ 2022-03-22 2519/week @ 2022-03-29 3121/week @ 2022-04-05 2296/week @ 2022-04-12 2873/week @ 2022-04-19 2629/week @ 2022-04-26 2562/week @ 2022-05-03 2294/week @ 2022-05-10

10,719 downloads per month
Used in 33 crates (via hp-log)

Unlicense OR MIT

11KB
182 lines

This crate has reached its end-of-life and is now deprecated.

This crate was rolled into the winapi-util crate since wincolor is quite small and didn't otherwise have a good reason for living life as a distinct crate.

The console module of winapi-util is a drop-in replacement for wincolor.

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

~51KB