A color is always brighter as Foreground than Background #956

Closed
opened 2026-01-30 22:12:22 +00:00 by claunia · 5 comments
Owner

Originally created by @krokofant on GitHub (May 10, 2019).

Environment
Windows build number: 10.0.18362.86
At Commit: 6c98fc19f5

What you're doing and what's happening:
Open a PowerShell prompt via the Terminal and execute a command that paints the foreground same as the background:

Write-Host "FOO BAR" -ForegroundColor DarkBlue -BackgroundColor DarkBlue

What's wrong / what should be happening instead:
The foreground is always a little bit brighter
image

Edit:
With the standard PowerShell theme it's easier to spot when using red:

Write-Host "FOO BAR" -ForegroundColor DarkRed -BackgroundColor DarkRed

image

Originally created by @krokofant on GitHub (May 10, 2019). **Environment** Windows build number: 10.0.18362.86 At Commit: 6c98fc19f53fdf30b1473190608f35a66621d66c **What you're doing and what's happening:** Open a PowerShell prompt via the Terminal and execute a command that paints the foreground same as the background: ```powershell Write-Host "FOO BAR" -ForegroundColor DarkBlue -BackgroundColor DarkBlue ``` **What's wrong / what should be happening instead:** The foreground is always a little bit brighter ![image](https://user-images.githubusercontent.com/5908498/57547690-5106d380-735f-11e9-81ca-dbcb555fa83d.png) **Edit:** With the standard PowerShell theme it's easier to spot when using red: ```powershell Write-Host "FOO BAR" -ForegroundColor DarkRed -BackgroundColor DarkRed ``` ![image](https://user-images.githubusercontent.com/5908498/57549282-667dfc80-7363-11e9-8020-192e7ce6d582.png)
claunia added the Help WantedArea-RenderingIssue-Bug labels 2026-01-30 22:12:22 +00:00
Author
Owner

@zadjii-msft commented on GitHub (May 10, 2019):

I'm not seeing lighter, but I am seeing different. That's crazy.
image

@zadjii-msft commented on GitHub (May 10, 2019): I'm not seeing lighter, but I am seeing different. That's crazy. ![image](https://user-images.githubusercontent.com/18356694/57548957-e38b8080-7327-11e9-91c2-9d7bbdda10f6.png)
Author
Owner

@krokofant commented on GitHub (May 10, 2019):

It actually seems like it's the background that is darker in the Terminalen compared to pwsh only.
image

@krokofant commented on GitHub (May 10, 2019): It actually seems like _it's the background_ that is darker in the Terminalen compared to pwsh only. ![image](https://user-images.githubusercontent.com/5908498/57555375-689c8700-7374-11e9-97b5-fb62cb7015a8.png)
Author
Owner

@ghosty141 commented on GitHub (May 10, 2019):

I found the issue/line that causes this, I'm not sure though, why this exists and if removing is fine. The issue is in DxRenderer.cpp where the following line changes the background color:

_d2dBrushBackground->SetOpacity(.9f);

Removing it fixes the issue.
WindowsTerminal_2019-05-11_01-15-41

@ghosty141 commented on GitHub (May 10, 2019): I found the issue/line that causes this, I'm not sure though, why this exists and if removing is fine. The issue is in DxRenderer.cpp where the following line changes the background color: _d2dBrushBackground->SetOpacity(.9f); Removing it fixes the issue. ![WindowsTerminal_2019-05-11_01-15-41](https://user-images.githubusercontent.com/17564201/57561131-53caee00-738a-11e9-9141-67fa3119d063.png)
Author
Owner

@krokofant commented on GitHub (May 11, 2019):

@Ghosty141 Great!

@krokofant commented on GitHub (May 11, 2019): @Ghosty141 Great!
Author
Owner

@PhMajerus commented on GitHub (May 11, 2019):

Good catch !
I was wondering why I was seeing modified colors in ANSI-art that used both background and foreground in my screenshots on #455.

@PhMajerus commented on GitHub (May 11, 2019): Good catch ! I was wondering why I was seeing modified colors in ANSI-art that used both background and foreground in my screenshots on #455.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#956