Background color looks different in powershell and standalone command prompt #16210

Closed
opened 2026-01-31 05:00:48 +00:00 by claunia · 4 comments
Owner

Originally created by @dotnetshadow on GitHub (Dec 20, 2021).

Windows Terminal version

1.11.34710

Windows build number

10.0.19044.1415

Other Software

.net core 6.0

Steps to reproduce

  1. Create a .net core 6 console application
  2. Use the following snippet
static void Main(string[] args)
        {

            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Clear();
            Console.WriteLine("Hello World!");
}
  1. The colors look different
    image

Expected Behavior

I expect the colors to match

Actual Behavior

The colors look different
image

Originally created by @dotnetshadow on GitHub (Dec 20, 2021). ### Windows Terminal version 1.11.34710 ### Windows build number 10.0.19044.1415 ### Other Software .net core 6.0 ### Steps to reproduce 1. Create a .net core 6 console application 2. Use the following snippet ```csharp static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.Blue; Console.Clear(); Console.WriteLine("Hello World!"); } ``` 3. The colors look different ![image](https://user-images.githubusercontent.com/296247/146765683-fc99f639-7712-430b-a21f-cec6af42a416.png) ### Expected Behavior I expect the colors to match ### Actual Behavior The colors look different ![image](https://user-images.githubusercontent.com/296247/146765683-fc99f639-7712-430b-a21f-cec6af42a416.png)
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-31 05:00:49 +00:00
Author
Owner

@237dmitry commented on GitHub (Dec 20, 2021):

In my opinion it depends on the settings of the 16 base colors of the console.

@237dmitry commented on GitHub (Dec 20, 2021): In my opinion it depends on the settings of the 16 base colors of the console.
Author
Owner

@237dmitry commented on GitHub (Dec 20, 2021):

0..15 | Foreach-Object { Write-Host $([consoleColor] $_) -ForegroundColor $_ }
@237dmitry commented on GitHub (Dec 20, 2021): ``` 0..15 | Foreach-Object { Write-Host $([consoleColor] $_) -ForegroundColor $_ } ```
Author
Owner

@dotnetshadow commented on GitHub (Dec 20, 2021):

@237dmitry Thanks, I think you are right it somehow chooses the bright color in the colorscheme. It must map the color.
I found out I would have to use the vintage colour scheme for it to appear correctly

@dotnetshadow commented on GitHub (Dec 20, 2021): @237dmitry Thanks, I think you are right it somehow chooses the bright color in the colorscheme. It must map the color. I found out I would have to use the vintage colour scheme for it to appear correctly
Author
Owner

@zadjii-msft commented on GitHub (Jan 3, 2022):

Yep, this is due to the Terminal and Conhost using different color schemes by default. When you're using ConsoleColor.Blue, you're merely telling the console/terminal "please draw this text in whatever color you think blue is"

@zadjii-msft commented on GitHub (Jan 3, 2022): Yep, this is due to the Terminal and Conhost using different color schemes by default. When you're using `ConsoleColor.Blue`, you're merely telling the console/terminal "please draw this text in whatever color you think blue is"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16210