a better coloring crate
add example to README and fix error in docs
bendn 2023-09-16
parent 17c3ed0 · commit 0af5816
-rw-r--r--README.md7
-rw-r--r--src/lib.rs4
2 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 970a585..55bb952 100644
--- a/README.md
+++ b/README.md
@@ -2,3 +2,10 @@
Small terminal coloring library, using proc macros.
See [lib.rs](https://docs.rs/comat) for more information.
+
+## Usage
+
+```rust
+use comat::cprintln;
+cprintln!("{red}C{yellow}O{green}L{blue}O{magenta}R{reset}!");
+```
diff --git a/src/lib.rs b/src/lib.rs
index 491dea9..2a852d9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,11 +23,11 @@
//! ```
//! vs
//! ```
-//! print!("\x1b[0;34;31mred\x1b[0m.");
+//! print!("\x1b[0;34;31m{thing}\x1b[0m.");
//! ```
//! vs
//! ```ignore
-//! print!("{}.", "red".red());
+//! print!("{}.", thing.red());
//! ```
//! - intuitive: you dont have to
//! ```ignore