Remove glsl if-else, add macro, separate new opt

This adds a config option called text_fg_override_threshold 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. The default is 0, and the computations will only be
performed if the option is set.

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.

I originally implemented this is as a parameter on
text_composition_strategy. For that to work, the option needed to
take _up to_ rather than _exactly_ the number of available
parameters. While it now has nothing to do with the new feature,
it seems like that change should be made anyway, so I'm leaving
it in for now.
This commit is contained in:
Luna McNulty
2023-05-20 09:54:43 -04:00
parent 05d94e8256
commit 9bd97b090d
8 changed files with 59 additions and 21 deletions

View File

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