/wincolor/README.md

https://github.com/BurntSushi/termcolor · Markdown · 55 lines · 39 code · 16 blank · 0 comment · 0 complexity · 2ee0792278b5a0e2c28019db73a3cfc4 MD5 · raw file

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