tabiew 0.14.2

A lightweight TUI application to view and query tabular data files, such as CSV, TSV, and parquet.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ratatui::style::Color;

pub trait ColorExt {
    fn darken(&self) -> Self;
}

impl ColorExt for Color {
    fn darken(&self) -> Self {
        match self {
            Color::Rgb(r, g, b) => Color::Rgb(
                (*r as f32 * 0.2) as u8,
                (*g as f32 * 0.2) as u8,
                (*b as f32 * 0.2) as u8,
            ),
            _ => *self,
        }
    }
}