• Home
Name Date Size #Lines LOC

..--

src/12-May-2024-286182

COPYINGD12-May-2024126 42

Cargo.tomlD12-May-2024611 2319

LICENSE-MITD12-May-20241.1 KiB2217

README.mdD12-May-20241.4 KiB5538

UNLICENSED12-May-20241.2 KiB2520

README.md

1## **This crate has reached its end-of-life and is now deprecated.**
2
3This crate was rolled into the
4[`winapi-util`](https://crates.io/crates/winapi-util)
5crate since `wincolor` is quite small and didn't otherwise have a good reason
6for living life as a distinct crate.
7
8The
9[`console`](https://docs.rs/winapi-util/0.1.*/x86_64-pc-windows-msvc/winapi_util/console/index.html)
10module of `winapi-util` is a drop-in replacement for `wincolor`.
11
12wincolor
13========
14A simple Windows specific API for controlling text color in a Windows console.
15The purpose of this crate is to expose the full inflexibility of the Windows
16console without any platform independent abstraction.
17
18[![](https://img.shields.io/crates/v/wincolor.svg)](https://crates.io/crates/wincolor)
19
20Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).
21
22### Documentation
23
24[https://docs.rs/wincolor](https://docs.rs/wincolor)
25
26### Usage
27
28Add this to your `Cargo.toml`:
29
30```toml
31[dependencies]
32wincolor = "0.1"
33```
34
35and this to your crate root:
36
37```rust
38extern crate wincolor;
39```
40
41### Example
42
43This is a simple example that shows how to write text with a foreground color
44of cyan and the intense attribute set:
45
46```rust
47use wincolor::{Console, Color, Intense};
48
49let mut con = Console::stdout().unwrap();
50con.fg(Intense::Yes, Color::Cyan).unwrap();
51println!("This text will be intense cyan.");
52con.reset().unwrap();
53println!("This text will be normal.");
54```
55