modcli/output/
gradient_extras.rs

1use crate::output::{colors, gradient};
2use crossterm::style::Color;
3
4/// Gradient helpers that accept named colors. Requires `features=["gradients"]`.
5/// These are thin wrappers over the existing gradient module.
6/// Two-color gradient using named colors.
7pub fn two_named(text: &str, from: &str, to: &str) -> String {
8    let c1 = colors::get(from);
9    let c2 = colors::get(to);
10    gradient::two_color(text, c1, c2)
11}
12
13/// Multi-color gradient using a list of named colors.
14pub fn multi_named(text: &str, names: &[&str]) -> String {
15    let stops: Vec<Color> = names.iter().map(|n| colors::get(n)).collect();
16    gradient::multi_color(text, stops)
17}