terminal is fixed and im not happy about it
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user