From f205dec1952808ed3c33e9bc5ad98d0dccb19f74 Mon Sep 17 00:00:00 2001 From: joveian <1261914+joveian@users.noreply.github.com> Date: Thu, 2 Nov 2023 06:17:41 -0700 Subject: [PATCH] Add comment about kitty's text_fg_override_threshold --- src/cli/hdcanvas.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cli/hdcanvas.rs b/src/cli/hdcanvas.rs index 64ebe03..e3257ab 100644 --- a/src/cli/hdcanvas.rs +++ b/src/cli/hdcanvas.rs @@ -75,6 +75,13 @@ impl Canvas { } } + // The kitty terminal has a feature text_fg_override_threshold that + // checks the difference in luminosity between text and background and + // changes the text to black or white to make it readable if the + // luminosity difference percentage is below the specified threshold. + // Using block characters for graphics display can trigger this, causing + // black or white lines or blocks, if the color is the same or too close. + // The checkerboard should be ok unless the theshold is set fairly high. pub fn print(&self, out: &mut dyn Write) -> Result<()> { for i_div_2 in 0..self.height / 2 { for j in 0..self.width {