PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/third_party/rust/wincolor/README.md

https://bitbucket.org/vionika/spin.android
Markdown | 44 lines | 31 code | 13 blank | 0 comment | 0 complexity | 1d45e5564feaf219ecf69d034451e743 MD5 | raw file
Possible License(s): JSON, 0BSD, AGPL-1.0, BSD-2-Clause, GPL-3.0, LGPL-2.1, LGPL-3.0, CC0-1.0, AGPL-3.0, MPL-2.0, Apache-2.0, MIT, BSD-3-Clause, MPL-2.0-no-copyleft-exception, GPL-2.0, Unlicense
  1. wincolor
  2. ========
  3. A simple Windows specific API for controlling text color in a Windows console.
  4. The purpose of this crate is to expose the full inflexibility of the Windows
  5. console without any platform independent abstraction.
  6. [![Windows build status](https://ci.appveyor.com/api/projects/status/github/BurntSushi/ripgrep?svg=true)](https://ci.appveyor.com/project/BurntSushi/ripgrep)
  7. [![](https://img.shields.io/crates/v/wincolor.svg)](https://crates.io/crates/wincolor)
  8. Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
  9. ### Documentation
  10. [https://docs.rs/wincolor](https://docs.rs/wincolor)
  11. ### Usage
  12. Add this to your `Cargo.toml`:
  13. ```toml
  14. [dependencies]
  15. wincolor = "0.1"
  16. ```
  17. and this to your crate root:
  18. ```rust
  19. extern crate wincolor;
  20. ```
  21. ### Example
  22. This is a simple example that shows how to write text with a foreground color
  23. of cyan and the intense attribute set:
  24. ```rust
  25. use wincolor::{Console, Color, Intense};
  26. let mut con = Console::stdout().unwrap();
  27. con.fg(Intense::Yes, Color::Cyan).unwrap();
  28. println!("This text will be intense cyan.");
  29. con.reset().unwrap();
  30. println!("This text will be normal.");
  31. ```