mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
1bf9156628
commit
1a2e5f4932
2 changed files with 12 additions and 1 deletions
|
|
@ -66,6 +66,10 @@
|
|||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
* `colors.alpha-mode=matching` not working as intended.
|
||||
|
||||
|
||||
### Security
|
||||
### Contributors
|
||||
|
||||
|
|
|
|||
9
render.c
9
render.c
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue