Tab background should use opacity from profile #19370

Open
opened 2026-01-31 06:41:17 +00:00 by claunia · 3 comments
Owner

Originally created by @mosterme on GitHub (Feb 12, 2023).

The tab background color is picked from the current profile, but the opacity is not.
Which makes the tabs appear even darker than the actual tab contents.

terminal-1 terminal-2

Light theme and GitBash on Solarized Dark with 70 opacity and useAcrylic.
Windows-Terminal Version: 1.16.10262.0

Setting RGBA color values for tab colors in themes already works.
But then you lose the color hue from the current profile.

Hovering over an inactive tab comes close to the expected result.

terminal-3

This is somewhat related to #14026 and #14815.

Originally created by @mosterme on GitHub (Feb 12, 2023). The tab background color is picked from the current profile, but the opacity is not. Which makes the tabs appear even darker than the actual tab contents. ![terminal-1](https://user-images.githubusercontent.com/6878281/218296616-576a83f9-6c0c-41c8-bee3-6cb9264b1491.png) ![terminal-2](https://user-images.githubusercontent.com/6878281/218296617-a690d986-d841-4142-a8d8-9a52959530a5.png) _Light theme and GitBash on Solarized Dark with 70 opacity and useAcrylic. Windows-Terminal Version: 1.16.10262.0_ Setting RGBA color values for tab colors in themes already works. But then you lose the color hue from the current profile. Hovering over an inactive tab comes close to the expected result. ![terminal-3](https://user-images.githubusercontent.com/6878281/218299141-6e628c30-717b-4777-a53b-24b61ebc19d5.png) This is somewhat related to #14026 and #14815.
claunia added the Issue-FeatureProduct-TerminalArea-Theming labels 2026-01-31 06:41:18 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 4, 2023):

Huh, why doesn't this work?

PERHAPS

if (const auto themeBrush{ tab->_themeColor.Evaluate(Application::Current().Resources(), terminalBrush, false) })
{
    // ThemeColor.Evaluate will get us a Brush (because the
    // TermControl could have an acrylic BG, for example). Take
    // that brush, and get the color out of it. We don't really
    // want to have the tab items themselves be acrylic.
    tab->_ApplyTabColorOnUIThread(til::color{ ThemeColor::ColorFromBrush(themeBrush) });
}

I wonder if we're setting the .Opacity on the brush, rather than the alpha, and doing the ThemeColor::Evaluate -> ColorFromBrush trip loses that Opacity that should really act as an alpha...

@zadjii-msft commented on GitHub (Apr 4, 2023): Huh, why doesn't this work? PERHAPS ```c++ if (const auto themeBrush{ tab->_themeColor.Evaluate(Application::Current().Resources(), terminalBrush, false) }) { // ThemeColor.Evaluate will get us a Brush (because the // TermControl could have an acrylic BG, for example). Take // that brush, and get the color out of it. We don't really // want to have the tab items themselves be acrylic. tab->_ApplyTabColorOnUIThread(til::color{ ThemeColor::ColorFromBrush(themeBrush) }); } ``` I wonder if we're setting the `.Opacity` on the brush, rather than the `alpha`, and doing the `ThemeColor::Evaluate` -> `ColorFromBrush` trip loses that `Opacity` that should really act as an alpha...
Author
Owner

@mosterme commented on GitHub (May 6, 2023):

After looking at #15294, I tried testing out https://learn.microsoft.com/en-us/windows/terminal/customize-settings/themes again.

    "theme": "theme1",
    "themes": [
        {
            "name": "theme1",
            "tab":
            {
                "background": "terminalBackground"
            },
            "window":
            {
                "applicationTheme": "system"
            }
        }       
    ],
    "useAcrylicInTabRow": true,

This is the result. First tab is inactive, second tab is hovering over, third tab is the active one. Inactive tabs already look nicer now.

terminal-4

But the following sentences from the documentation make me doubt the desired result can currently be achieved with themes.

This color is always treated as a solid color, even if set to a terminalBackground of a pane with an acrylic background.

When set to terminalBackground or accent, this will automatically use an alpha value of 30%, to be semi-transparent.

@mosterme commented on GitHub (May 6, 2023): After looking at #15294, I tried testing out https://learn.microsoft.com/en-us/windows/terminal/customize-settings/themes again. ``` "theme": "theme1", "themes": [ { "name": "theme1", "tab": { "background": "terminalBackground" }, "window": { "applicationTheme": "system" } } ], "useAcrylicInTabRow": true, ``` This is the result. First tab is inactive, second tab is hovering over, third tab is the active one. Inactive tabs already look nicer now. ![terminal-4](https://user-images.githubusercontent.com/6878281/236599004-5b7748c6-a5e1-4cd5-8556-994bad04d671.png) But the following sentences from the documentation make me doubt the desired result can currently be achieved with themes. > This color is always treated as a solid color, even if set to a terminalBackground of a pane with an acrylic background. > When set to terminalBackground or accent, this will automatically use an alpha value of 30%, to be semi-transparent.
Author
Owner

@Anutrix commented on GitHub (Apr 6, 2024):

Not sure if this should be separate ticket but currently there's no way to set opacity of Tab-Row. Only acrylic blur is possible.
Terminal section itself has both opacity and acrylic settings but tab-row only has Acrylic Blur setting.

image
What if I want this part transparent?
See how I can read words behind terminal but there's block where you can't read anything.
Note that I am not taking about the tab titles but about the tab-row behind it.

@Anutrix commented on GitHub (Apr 6, 2024): Not sure if this should be separate ticket but currently there's no way to set opacity of Tab-Row. Only acrylic blur is possible. Terminal section itself has both opacity and acrylic settings but tab-row only has Acrylic Blur setting. ![image](https://github.com/microsoft/terminal/assets/11459028/a9aab72a-6f08-462e-a529-cdf23624b59f) What if I want this part transparent? See how I can read words behind terminal but there's block where you can't read anything. Note that I am not taking about the tab titles but about the tab-row behind it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19370