First commit
CI / fmt (push) Has been cancelled
CI / clippy (push) Has been cancelled
CI / doc (push) Has been cancelled
CI / test macos-latest (push) Has been cancelled
CI / test windows-latest (push) Has been cancelled

This commit is contained in:
2026-08-08 18:06:13 +02:00
committed by surv
commit 0f1194aeca
18 changed files with 1068 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
use ratatui::{style::Stylize, text::Line};
pub fn colorize<'a>(mut txt: &'a str, width: usize, out: &mut Line<'a>) {
let mut color = false;
if !txt.len().is_multiple_of(width) {
*out += txt[..txt.len() % width].red();
color = !color;
txt = &txt[txt.len() % width..];
}
for _ in 0..txt.len() / width {
if color {
*out += txt[0..width].cyan();
} else {
*out += txt[0..width].red();
}
txt = &txt[width..];
color = !color;
}
}