microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.16k stars 29.28k forks source link

Add a setting to support RGB color profile chosen by OS #65816

Closed vincentmathis closed 5 years ago

vincentmathis commented 5 years ago

Version: 1.30.1 Commit: dea8705087adb1b5e5ae1d9123278e178656186a Date: 2018-12-18T18:07:32.870Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Linux x64 4.15.0-43-generic

Steps to Reproduce:

  1. take screenshot of vscode and atom (or even gThumb) next to each other
  2. change os/monitor color profile
  3. take another screenshot of both

This is Atom with my default color profile, colors are vibrant atom-os-profile-thinkpad This is Atom after I changend my color profile to sRGB in the operating system settings (Atom itself also has an option to force sRGB which would produce the same result), colors are washed out atom-os-profile-srgb

This is VSCode with the exact same color theme and hex values (in theory) and default color profile, colors are washed out compared to atom with default color profile vscode-os-profile-thinkpad This is VSCode after I changed my color profile to sRGB in the operating system. It looks exactly the same as before. vscode-os-profile-srgb

Is there a possibility that VSCode would use the OS chosen colorprofile? Currently the colors in VSCode look a little bit washed out on my monitor.

carestad commented 5 years ago

I am seeing this as well, in Ubuntu. I believe it is related to Chrome/Chromium having difficulties detecting screen changes after a suspend/resume cycle, where one might dock/undock a laptop and change monitors (going from a dual monitor setup to just using the built-in for instance).

I reported a bug with chromium a wile back regarding this, but so far the only thing that really works is forcing srgb as a color profile, that way the colors stay the same no matter.

I do believe this only started happening for me in VSCode only a few weeks ago though. Could be due to Electron 3.0 finally being shipped in 1.31?

Also, I can see that Atom allows one to set the color profile in their settings, so why not in VSCode as well?

mike391 commented 5 years ago

Chrome has been doing this to me as well, but I was able to fix it by forcing sRGB profile in chrome://flags. I cant see this being tough to implement in vscode as well.

jdsimcoe commented 5 years ago

I'm seeing this same issues on macOS with the latest build of VSCode Insiders: Version 1.32.0-insider. A manual workaround that seemed to solve it was to add a line of code to main.js inside the VSCode app bundle:

app.commandLine.appendSwitch('force-color-profile', 'srgb');

douglasmiranda commented 5 years ago

My workaround for now for Ubuntu + Nvidia: https://gist.github.com/douglasmiranda/2781fd3a5cf6c143184ddde06e8e7cca#color-issues-in-vscode

felrib commented 5 years ago

The bright colors are gone since last VSCode update (1.36). Using on Ubuntu 19.04.

Trying with --force-color-profile=srgb makes no difference.

douglasmiranda commented 5 years ago

Yep! Now it seems to be working properly.

Vscode 1.36 Ubuntu 18.04.2 GeForce GTX 1050 Ti (nvidia-driver-430 open source)


Edit: Now I'm looking at the processes of Vscode and it seems it's launching with --force-color-profile=srgb by default. (At least I haven't changed the launcher)

felrib commented 5 years ago

Actually I meant that now (1.36) all colors are too opaque. 1.35 was fine.

@douglasmiranda Is it working fine on your setup?

douglasmiranda commented 5 years ago

Oh I see, I thought you're saying it was ok now.

Here it seems to be ok.

felrib commented 5 years ago

Thanks for the heads up :)

codeart1st commented 5 years ago

I have similar issues since 1.36 with a dual monitor setup. If i working on my normal pc monitor without HDR support I see washed out colors. This happens only in combination with a secondary HDR monitor. If I disable the HDR support of the second monitor in Windows all seems to be ok in VS Code.

AngellusMortis commented 5 years ago

I have similar issues since 1.36 with a dual monitor setup. If i working on my normal pc monitor without HDR support I see washed out colors. This happens only in combination with a secondary HDR monitor. If I disable the HDR support of the second monitor in Windows all seems to be ok in VS Code.

I have the exact same issue. I cannot upgrade passed 1.35 until this issue is resolved (or you start defaulting to SDR when you have a HDR and SDR monitor). It is a major blocker for me upgrading as I do not think being forced to use the CLI arg to open VS Code all of the time is a proper solution.

bpasero commented 5 years ago

People seeing this issue, can please try how the situation is with our new Electron 6 enabled builds:

We are building exploration builds that use a much newer version of our UI framework (Electron version 6.0.x). I wonder if this issue reproduces with one of these builds, could you try? Download:

wangzishi commented 5 years ago

It seems fix this HDR issue on Windows.

image

felrib commented 5 years ago

image Left: 1.37.0 Exploration Right: 1.36.1 Both: using One Dark Pro Vivid theme Ubuntu 19.04

It's finally resolved!

bpasero commented 5 years ago

If this turns out to be fixed with Electron 6, I think we can survive without having this setting configurable.

deepak1556 commented 5 years ago

Fixed with https://github.com/microsoft/vscode/pull/81644