Expand description
Rainbow ANSI colorizer for terminal output. Helpers to colorize text with a left-to-right rainbow.
Provides:
colorize_text_with_width(text, Option<usize>) -> String
The functions emit 24-bit ANSI foreground escapes (\x1b[38;2;R;G;Bm).
If rainbow_width is None the rainbow spans the widest line in text.
The output contains newline characters and is ready to print.
Functionsยง
- colorize_
text_ with_ width - Colorize the provided
textwith a left-to-right rainbow. Ifrainbow_widthisNonethe rainbow will span the full width of the widest line. If a width is provided the gradient is computed across that width and repeats when lines are longer.