terminal is fixed and im not happy about it

This commit is contained in:
Zacharias-Brohn
2026-04-10 00:29:13 +02:00
parent 5129612f9f
commit 32ce278743
4 changed files with 188 additions and 69 deletions
+9
View File
@@ -186,6 +186,15 @@ impl Default for ColorPalette {
}
impl ColorPalette {
/// Return whether this palette is considered "light" based on default background luminance.
pub fn is_light(&self) -> bool {
let [r, g, b] = self.default_bg;
// Standard perceived luminance calculation
let luminance =
0.299 * (r as f32) + 0.587 * (g as f32) + 0.114 * (b as f32);
luminance > 128.0
}
/// Parse a color specification like "#RRGGBB" or "rgb:RR/GG/BB".
pub fn parse_color_spec(spec: &str) -> Option<[u8; 3]> {
let spec = spec.trim();