https://github.com/rk3141/rainbow
Write text in rainbow colors!
https://github.com/rk3141/rainbow
rainbow rainbow-colors rust rust-crate
Last synced: 3 months ago
JSON representation
Write text in rainbow colors!
- Host: GitHub
- URL: https://github.com/rk3141/rainbow
- Owner: rk3141
- License: mit
- Created: 2020-11-15T10:21:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-08T02:58:41.000Z (over 5 years ago)
- Last Synced: 2026-01-11T18:40:11.246Z (5 months ago)
- Topics: rainbow, rainbow-colors, rust, rust-crate
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rainbow
A crate for writing text in rainbow colors.
# Examples
### Write text with foreground colors
```rust
use rainbow_text::Rainbow;
fn main() -> std::io::Result<()>
{
let rain = Rainbow::default();
rain.write("Hello, World")?;
Ok(())
}
```
### Write text with background colors
```rust
use rainbow_text::Rainbow;
fn main() -> std::io::Result<()>
{
let rain = Rainbow::default();
rain.write_bg("Hello, World")?;
Ok(())
}
```
### Custom Rainbows!
```rust
use rainbow_text::{ Rainbow, Color };
fn main() -> std::io::Result<()>
{
let rain = Rainbow::custom(
vec![
Color::Rgb(255,0,0),
Color::Rgb(0,255,0),
Color::Rgb(0,0,255),
]
);
rain.write("Hello, World")?;
Ok(())
}
```