generate

Function generate 

Source
pub fn generate(text: &str, start: Color, end: Color) -> String
Expand description

Generates a horizontal gradient between two colors. This can be used for printing rainbow text or gradual transitions. This function returns a single string with the gradient applied. The text is split into characters, and each character is colored according to its position in the gradient. The gradient is calculated by interpolating between the start and end colors based on the character’s index. The result is a string where each character is styled with its corresponding color.