Expand description
tiny-gradient
colorful gradients for your terminal.
§Gradient usage
use tiny_gradient::{Gradient, GradientStr};
let text = "Hello World!";
let colored = text.gradient(Gradient::Forest);
println!("{}", colored);
§RGB usage
use tiny_gradient::{RGB, GradientStr};
let text = "Hello World!";
let colored = text.gradient([RGB::new(0x01, 0x00, 0x00), RGB::new(0xDA, 0x00, 0xFF)]);
println!("{}", colored);
§Generator usage
use tiny_gradient::{gradient::Gradient, RGB};
let mut gradient = Gradient::new(RGB::new(0x01, 0x00, 0x00), RGB::new(0xDA, 0x00, 0xFF), 10);
for color in gradient {
println!("{:?}", color);
}
Modules§
Structs§
- Gradient
Display - A gradient string representation.
- RGB
- Red Green Blue
Enums§
- Gradient
- A list of built-in gradient themes.
Traits§
- Gradient
Str - Methods to colorize string with a gradient.