diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-04-19 05:46:06 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-04-19 11:33:23 +0000 |
| commit | 1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9 (patch) | |
| tree | 1cc6db71597f1a007cffa4856ca3348ab6e5a1b8 | |
| parent | doc: foot.ini: spaces -> tab (for indentation) (diff) | |
render: fix colors.alpha-mode=matching
Before this patch, it only matched RGB color sources. It did not match
the default bg color, or indexed colors. That is, e.g. CSI 43m didn't
apply alpha, even if the color3 matched the default background color.
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | render.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d8787775..6958c869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,10 @@ ### Deprecated ### Removed ### Fixed + +* `colors.alpha-mode=matching` not working as intended. + + ### Security ### Contributors @@ -754,8 +754,15 @@ render_cell(struct terminal *term, pixman_image_t *pix, } case ALPHA_MODE_MATCHING: { - if (cell->attrs.bg == term->colors.bg) + if (cell->attrs.bg_src == COLOR_DEFAULT || + ((cell->attrs.bg_src == COLOR_BASE16 || + cell->attrs.bg_src == COLOR_BASE256) && + term->colors.table[cell->attrs.bg] == term->colors.bg) || + (cell->attrs.bg_src == COLOR_RGB && + cell->attrs.bg == term->colors.bg)) + { alpha = term->colors.alpha; + } break; } |
