From cdfc864cf06645b341266877a3e2c8615b0c43f0 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 17 Apr 2021 21:57:08 +0200 Subject: config: bold-text-in-bright: add ‘palette-based’ as a special value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ‘bold-text-in-bright’ is set ‘to palette-based’, colors matching one of the 8 regular palette colors are brightened by using the corresponding bright palette color. Other colors, or all colors if ‘bold-text-in-bright’ is set to ‘yes|true’, are brightened by increasing the luminance. --- config.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 653c3f8a..3aed1e7d 100644 --- a/config.c +++ b/config.c @@ -583,8 +583,15 @@ parse_section_main(const char *key, const char *value, struct config *conf, conf->resize_delay_ms = ms; } - else if (strcmp(key, "bold-text-in-bright") == 0) - conf->bold_in_bright = str_to_bool(value); + else if (strcmp(key, "bold-text-in-bright") == 0) { + if (strcmp(value, "palette-based") == 0) { + conf->bold_in_bright.enabled = true; + conf->bold_in_bright.palette_based = true; + } else { + conf->bold_in_bright.enabled = str_to_bool(value); + conf->bold_in_bright.palette_based = false; + } + } else if (strcmp(key, "bell") == 0) { if (strcmp(value, "set-urgency") == 0) @@ -2193,7 +2200,10 @@ config_load(struct config *conf, const char *conf_path, .pad_x = 2, .pad_y = 2, .resize_delay_ms = 100, - .bold_in_bright = false, + .bold_in_bright = { + .enabled = false, + .palette_based = false, + }, .bell_action = BELL_ACTION_NONE, .startup_mode = STARTUP_WINDOWED, .fonts = {tll_init(), tll_init(), tll_init(), tll_init()}, -- cgit v1.3