Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some colors are swapped in Terminal #571

Closed
melund opened this issue May 8, 2019 · 8 comments
Closed

Some colors are swapped in Terminal #571

melund opened this issue May 8, 2019 · 8 comments
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Milestone

Comments

@melund
Copy link

melund commented May 8, 2019

The red/blue and as yellow/cyan colors are swapped in the new Terminal when using the Campbell color scheme.

The color order is incorrect in "profiles.json". They should have the same order as in campbell.ini

image

@zadjii-msft
Copy link
Member

Ah see, they actually shouldn't.

Windows does colors weird for whatever reason, and does them in BGR order, while the rest of the world does them in RGB order. so, conhost's color table was always in BGR order, and when you were using VT sequences to set colors, you'd always have to translate the indices to their equivalent RGB-ordered indices.

Having the color table in RGB order removes a bunch of this logic, and makes our compatibility with other terminals a bit higher :)

@zadjii-msft zadjii-msft added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered labels May 8, 2019
@melund
Copy link
Author

melund commented May 9, 2019

Thanks @zadjii-msft. That makes sense. But it wasn't what was causing my colors to get swapped. Also, it appears to only affect 24 bit ansi colors. So maybe not directly related to the color scheme.

I only see some weird behavior when trying output some particular RGB colors. For example this blue color (0,55,218) which outputs as red.

image

If I just change the color slightly (e.g. [0,55, 219]) it becomes blue again:
image

It only appears to happen if I print the colors which are already in the ColorScheme list and have already been used with the standard 16 color ansi codes. Additionally, it seems it only affects those colors which were swapped in the new ordering of the ColorScheme list.

So maybe some caching is going wrong. Just a guess.

@zadjii-msft
Copy link
Member

Woah okay, that's insane.

Yea I can dig in to that.

@zadjii-msft zadjii-msft reopened this May 9, 2019
@zadjii-msft zadjii-msft added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered labels May 9, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 9, 2019
@waf
Copy link
Contributor

waf commented May 9, 2019

I experienced this when I was porting my cmd/powershell theme to the new terminal. Here are expected / actual colors:

Expected Order Actual Order
dark black dark black
dark blue dark red
dark green dark green
dark cyan dark yellow
dark red dark blue
dark magenta dark magenta
dark yellow dark cyan
dark white dark white
bright black bright black
bright blue bright red
bright green bright green
bright cyan bright yellow
bright red bright blue
bright magenta bright magenta
bright yellow bright cyan
bright white bright white

@ExE-Boss
Copy link

ExE-Boss commented May 15, 2019

Unfortunately, the current order is correct according to ANSI, while the order this issue wants to use would break ANSI 4bit indexed colour, which goes:

ANSI Colour Colour Code
Dark Black #0C0C0C
Dark Red #C50F1F
Dark Green #13A10E
Dark Yellow #C19C00
Dark Blue #0037DA
Dark Magenta #881798
Dark Cyan #3A96DD
Dark White #CCCCCC
Bright Black #767676
Bright Red #E74856
Bright Green #16C60C
Bright Yellow #F9F1A5
Bright Blue #3878FF
Bright Magenta #B4009E
Bright Cyan #61D6D6
Bright White #F2F2F2

@melund
Copy link
Author

melund commented May 15, 2019

Yes. The order was not the problem. But some colors are rendered incorrectly when using the explicit 24 bit ansi escapes. It seems it only happens when when trying to render the colors from 4 bit list, and then only for colors which swapped place from the old ordering to new correct one. Seems a bit peculiar.

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@DHowett-MSFT
Copy link
Contributor

But some colors are rendered incorrectly when using the explicit 24 bit ansi escapes.

I never put 2&2 together here, but I think this is /dup #2661.

@ghost
Copy link

ghost commented Jan 28, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Jan 28, 2020
@ghost ghost added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jan 28, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

7 participants