aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-04-17 19:57:08 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-04-17 20:00:48 +0000
commitcdfc864cf06645b341266877a3e2c8615b0c43f0 (patch)
treeb9601df11ad83a7e3ed0231827f2cdbc09258182 /render.c
parentrender: brighten: use corresponding bright palette color for base 8 colors (diff)
config: bold-text-in-bright: add ‘palette-based’ as a special value
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.
Diffstat (limited to 'render.c')
-rw-r--r--render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/render.c b/render.c
index 3ca0deeb..5efc7c67 100644
--- a/render.c
+++ b/render.c
@@ -258,9 +258,11 @@ color_brighten(const struct terminal *term, uint32_t color)
* First try to match the color against the base 8 colors. If we
* find a match, return the corresponding bright color.
*/
- for (size_t i = 0; i < 8; i++) {
- if (term->colors.table[i] == color)
- return term->colors.table[i + 8];
+ if (term->conf->bold_in_bright.palette_based) {
+ for (size_t i = 0; i < 8; i++) {
+ if (term->colors.table[i] == color)
+ return term->colors.table[i + 8];
+ }
}
int hue, sat, lum;
@@ -443,7 +445,7 @@ render_cell(struct terminal *term, pixman_image_t *pix,
if (cell->attrs.dim)
_fg = color_dim(_fg);
- if (term->conf->bold_in_bright && cell->attrs.bold)
+ if (term->conf->bold_in_bright.enabled && cell->attrs.bold)
_fg = color_brighten(term, _fg);
if (cell->attrs.blink && term->blink.state == BLINK_OFF)