Add foreground override contrast threshold

This adds a parameter to text_composition_strategy that specifies
a percentage difference luminance below which the foreground
color will be overridden. The foreground color is set to white if
the background is dark or black if the background is light.

Many programs output colors that look good with the author's
terminal's color scheme but which are completely illegible with
other color schemes. This allows the user ensure that there is
always sufficient contrast to read the text on the screen.

Since we want existing configs to continue working, this also
makes it so that rather than taking exactly two parameters,
text_composition_strategy takes one--three parameters, using the
default values for those not specified.
This commit is contained in:
Luna McNulty
2023-05-18 11:06:00 -04:00
parent 9a0068e318
commit 05d94e8256
5 changed files with 45 additions and 12 deletions

View File

@@ -48,7 +48,7 @@ typedef struct {
WindowTitleIn macos_show_window_title_in;
char *bell_path, *bell_theme;
float background_opacity, dim_opacity;
float text_contrast, text_gamma_adjustment;
float text_contrast, text_gamma_adjustment, text_fg_override_threshold;
bool text_old_gamma;
char *background_image, *default_window_logo;