aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display/content.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2021-08-16 14:49:14 +0300
committerGitHub <noreply@github.com>2021-08-16 14:49:14 +0300
commitc24d7dfd0d2d8849f0398d7cb1a65d6562ee7a0d (patch)
tree07470a57149be0fdb907ffb33ccd124dfb57848a /alacritty/src/display/content.rs
parent9a8ae43c0aa9e598411964c458c88f58d6ec41d8 (diff)
downloadr-alacritty-c24d7dfd0d2d8849f0398d7cb1a65d6562ee7a0d.tar.gz
r-alacritty-c24d7dfd0d2d8849f0398d7cb1a65d6562ee7a0d.tar.bz2
r-alacritty-c24d7dfd0d2d8849f0398d7cb1a65d6562ee7a0d.zip
Add option to apply opacity to all background colors
In some cases it could be desired to apply 'background_opacity' to all background colors instead of just 'colors.primary.background', thus adding an 'colors.opaque_background_colors' option to control that. Fixes #741.
Diffstat (limited to 'alacritty/src/display/content.rs')
-rw-r--r--alacritty/src/display/content.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs
index 05bd0438..2deb3d3e 100644
--- a/alacritty/src/display/content.rs
+++ b/alacritty/src/display/content.rs
@@ -203,7 +203,7 @@ impl RenderableCell {
mem::swap(&mut fg, &mut bg);
1.0
} else {
- Self::compute_bg_alpha(cell.bg)
+ Self::compute_bg_alpha(&content.config.ui_config, cell.bg)
};
let is_selected = content.terminal_content.selection.map_or(false, |selection| {
@@ -350,9 +350,11 @@ impl RenderableCell {
/// using the named input color, rather than checking the RGB of the background after its color
/// is computed.
#[inline]
- fn compute_bg_alpha(bg: Color) -> f32 {
+ fn compute_bg_alpha(config: &UiConfig, bg: Color) -> f32 {
if bg == Color::Named(NamedColor::Background) {
0.
+ } else if config.colors.transparent_background_colors {
+ config.window_opacity()
} else {
1.
}