diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-10-10 09:10:38 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-10-10 09:10:38 +0000 |
| commit | 7ed36c10334c0b2480fa026238f8f1791d2f9439 (patch) | |
| tree | dffe1021b5d308fb856185d8f64c7a7197df145a /config.c | |
| parent | changelog: updated jump label colors in modus-operandi (diff) | |
config: add colors.dim-blend-towards=black|white
Before this patch, we always blended towards black when dimming
text. However, with light color themes, it usually looks better if we
dim towards white instead.
This option allows you to choose which color to blend towards.
The default is 'black' in '[colors]', and 'white' in '[colors2]'.
Closes #2187
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1519,7 +1519,7 @@ parse_color_theme(struct context *ctx, struct color_theme *theme) return true; } - else if (strcmp(key, "alpha-mode") == 0) { + else if (streq(key, "alpha-mode")) { _Static_assert(sizeof(theme->alpha_mode) == sizeof(int), "enum is not 32-bit"); @@ -1529,6 +1529,16 @@ parse_color_theme(struct context *ctx, struct color_theme *theme) (int *)&theme->alpha_mode); } + else if (streq(key, "dim-blend-towards")) { + _Static_assert(sizeof(theme->dim_blend_towards) == sizeof(int), + "enum is not 32-bit"); + + return value_to_enum( + ctx, + (const char *[]){"black", "white", NULL}, + (int *)&theme->dim_blend_towards); + } + else { LOG_CONTEXTUAL_ERR("not valid option"); return false; @@ -3428,6 +3438,7 @@ config_load(struct config *conf, const char *conf_path, .flash_alpha = 0x7fff, .alpha = 0xffff, .alpha_mode = ALPHA_MODE_DEFAULT, + .dim_blend_towards = DIM_BLEND_TOWARDS_BLACK, .selection_fg = 0x80000000, /* Use default bg */ .selection_bg = 0x80000000, /* Use default fg */ .cursor = { @@ -3523,6 +3534,8 @@ config_load(struct config *conf, const char *conf_path, memcpy(conf->colors.table, default_color_table, sizeof(default_color_table)); memcpy(conf->colors.sixel, default_sixel_colors, sizeof(default_sixel_colors)); memcpy(&conf->colors2, &conf->colors, sizeof(conf->colors)); + conf->colors2.dim_blend_towards = DIM_BLEND_TOWARDS_WHITE; + parse_modifiers(XKB_MOD_NAME_SHIFT, 5, &conf->mouse.selection_override_modifiers); tokenize_cmdline( |
