diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-02-09 17:41:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 17:41:57 +0300 |
commit | 59f16f6b1568d95e7b183c75742c537b3f09a47d (patch) | |
tree | 59718fc80cc698fcbdcc49073a0255d4296e5bf1 /alacritty/res/text.f.glsl | |
parent | 73c3dd86280e98e11f080123aec47d08f3a76b49 (diff) | |
download | r-alacritty-59f16f6b1568d95e7b183c75742c537b3f09a47d.tar.gz r-alacritty-59f16f6b1568d95e7b183c75742c537b3f09a47d.tar.bz2 r-alacritty-59f16f6b1568d95e7b183c75742c537b3f09a47d.zip |
Fix alpha when using `colors.transparent_background_colors`
The alpha is expected to be premultiplied from the text shader, so
we should apply it to the background color.
Diffstat (limited to 'alacritty/res/text.f.glsl')
-rw-r--r-- | alacritty/res/text.f.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/alacritty/res/text.f.glsl b/alacritty/res/text.f.glsl index 5b4e3da6..3b8cd67c 100644 --- a/alacritty/res/text.f.glsl +++ b/alacritty/res/text.f.glsl @@ -18,7 +18,9 @@ void main() { } alphaMask = vec4(1.0); - color = vec4(bg.rgb, bg.a); + + // Premultiply background color by alpha. + color = vec4(bg.rgb * bg.a, bg.a); } else if ((int(fg.a) & COLORED) != 0) { // Color glyphs, like emojis. vec4 glyphColor = texture(mask, TexCoords); |