aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-16 14:26:52 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-16 14:26:52 +0000
commitb647aa447bb64b249fe61476b61d694198c1b9a6 (patch)
treeced749afd9b08b4b1fb601459a36faf20d7c8ed0
parentreadme: add 'synchronized updates' to feature list (diff)
render: only apply transparency to the default background color
-rw-r--r--CHANGELOG.md5
-rw-r--r--render.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1e02eec4..bce49494 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,12 @@
* `Sync` to terminfo. This is a tmux extension that indicates
_"Synchronized Updates"_ are supported.
+
### Changed
+
+* Background transparency to only be used with the default background
+ color.
+
### Deprecated
### Removed
### Fixed
diff --git a/render.c b/render.c
index 2af605c8..fb6b1794 100644
--- a/render.c
+++ b/render.c
@@ -390,7 +390,8 @@ render_cell(struct terminal *term, pixman_image_t *pix,
_fg = _bg;
pixman_color_t fg = color_hex_to_pixman(_fg);
- pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, term->colors.alpha);
+ pixman_color_t bg = color_hex_to_pixman_with_alpha(
+ _bg, _bg == term->colors.bg ? term->colors.alpha : 0xffff);
if (cell->attrs.dim)
color_dim(&fg);
@@ -502,7 +503,8 @@ render_margin(struct terminal *term, struct buffer *buf, int start_line, int end
const int line_count = end_line - start_line;
uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
- pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, term->colors.alpha);
+ pixman_color_t bg = color_hex_to_pixman_with_alpha(
+ _bg, _bg == term->colors.bg ? term->colors.alpha : 0xffff);
if (term->is_searching)
color_dim(&bg);