Macro generate_gradient_text
Source macro_rules! generate_gradient_text {
($txt:expr, $gr:expr) => { ... };
($txt:expr, $gr:expr, $bgtype:expr) => { ... };
}
Expand description
§Macro for generating gradient text that returns a Vec<Span> with the inputted gradient.
§Parameters
- any type that can be converted to Line (String, Line, &str, Vec)
- a colorgrad gradient (can be either Box or an owned type)
let gradient_text = generate_gradient_text!("Rainbow Text", colorgrad::preset::rainbow());
buf.set_line(1, 1, &gradient_text, gradient_text.width())