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

Allow to disable hardcoded color profile selection #51791

Closed
lediur opened this issue Jun 13, 2018 · 9 comments
Closed

Allow to disable hardcoded color profile selection #51791

lediur opened this issue Jun 13, 2018 · 9 comments
Labels
feature-request Request for new features or functionality workbench-electron Electron-VS Code issues

Comments

@lediur
Copy link

lediur commented Jun 13, 2018

  • VSCode Version: 1.25.0-insider fa7ded2f007be6ae288b29392501f3dc34105abd (with Electron 2.0.2)
  • OS Version: Windows 10 Pro 17134

Steps to Reproduce:

  1. Use monitors with specific color profiles (I have two external monitors and a laptop screen, all of which use different profiles corresponding to sRGB)
  2. Open VSCode. Colors are rendered correctly.

image

  1. Disconnect and reconnect monitors.
  2. VSCode / Electron refreshes color profiles and starts rendering colors incorrectly (washed out as if rendering sRGB on a display expecting Adobe RGB)

image

  1. If you restart VSCode Insider (may have to restart all other instances of VSCode, including stable), the colors are correct again until monitor configuration is changed

Does this issue occur when all extensions are disabled?: Yes

May be related to electron/electron#10732 and recent upgrade to Electron 2 (VSCode stable 1.24.0 doesn't exhibit this issue).

@RMacfarlane RMacfarlane added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jun 14, 2018
@bpasero bpasero added electron-update electron Issues and items related to Electron labels Jun 14, 2018
@thomasjo
Copy link

See atom/atom#17380.

@bpasero
Copy link
Member

bpasero commented Jun 15, 2018

@lediur can you give this a try:

  • quit any running VSCode Insiders
  • open C:\Program Files\Microsoft VS Code Insiders\resources\app\out\main.js
  • find the place where it reads app.commandLine.appendSwitch("disable-mojo-local-storage");
    right after paste this: app.commandLine.appendSwitch('force-color-profile', 'srgb');
  • save (you will need to save as admin I guess)
  • start VSCode Insiders again
    => does the issue still reproduce?

@lediur
Copy link
Author

lediur commented Jun 15, 2018

Thanks for the heads up @bpasero. I saw that workaround earlier in the aforementioned atom and electron issues but wasn't sure how to inject that into an installed version of VSCode.

I tested out the workaround and can confirm the issue no longer occurs.

@bpasero bpasero changed the title When using multiple color profiles, VSCode renders colors incorrectly Electron 2.0.x is starting to use a different color profile Jun 15, 2018
@bpasero bpasero changed the title Electron 2.0.x is starting to use a different color profile Electron 2.0.x is using a different color profile Jun 15, 2018
@lediur
Copy link
Author

lediur commented Jun 15, 2018

Hmm, I just unplugged my laptop without reconnecting to monitors and the issue actually appears to not have been fixed with that change. nevermind, it's because I updated VSCode.

@bpasero
Copy link
Member

bpasero commented Jun 16, 2018

@jasonrudolph @daviwil may I ask: any reason you guys decided to not change the default in atom/atom#17380 to be 'force-color-profile': 'srgb'? Is there a benefit from leaving this as Chrome decides to that you are aware of?

@bpasero bpasero changed the title Electron 2.0.x is using a different color profile [mitigated] Electron 2.0.x is using a different color profile Jun 18, 2018
@jasonrudolph
Copy link

any reason you guys decided to not change the default in atom/atom#17380 to be 'force-color-profile': 'srgb'? Is there a benefit from leaving this as Chrome decides to that you are aware of?

@bpasero: I have to admit that my experience working with color profiles is essentially nonexistent prior to atom/atom#17380, but I'll try to explain our thinking. 😅

Assume a developer has taken the time to calibrate the color profile for their display. As a result, they see that Photoshop (and various other apps) respect that color profile and render colors accordingly. The user has said, "When rendering colors on this display, apply these adjustments to ensure that colors are rendered correctly." If Atom always forces the color profile to sRGB, Atom is ignoring that user's instructions, and the user has no way to get Atom to render colors in accordance with the color profile. 🙁

With that in mind, we've chosen to respect the color profile by default. For the subset of users that want apps like Photoshop to honor their color profile, but want Atom to ignore the color profile, we provide a configuration option that allows those users to force the color profile to sRGB in Atom. :atom: 🎨 🙂

I hope that context is helpful.

For what it's worth, I found this doc from the Chrome team (shared in electron/electron#10732 (comment)) to be a valuable reference in understanding the background for Chrome's updated handling of color profiles.

@bpasero
Copy link
Member

bpasero commented Jun 19, 2018

@jasonrudolph thanks, that document is really helpful. It looks like not changing the defaults and having a setting is the right thing to do.

@bpasero bpasero changed the title [mitigated] Electron 2.0.x is using a different color profile Electron: Allow to disable hardcoded color profile selection Jul 9, 2018
@bpasero bpasero added feature-request Request for new features or functionality workbench-electron Electron-VS Code issues and removed electron-update electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Jul 9, 2018
@bpasero bpasero removed their assignment Jul 9, 2018
@bpasero bpasero changed the title Electron: Allow to disable hardcoded color profile selection Electron 2.0.x: Allow to disable hardcoded color profile selection Jul 9, 2018
@bpasero bpasero added feature-request Request for new features or functionality and removed feature-request Request for new features or functionality electron-update labels Jul 9, 2018
@bpasero bpasero changed the title Electron 2.0.x: Allow to disable hardcoded color profile selection Allow to disable hardcoded color profile selection Aug 6, 2018
@bpasero
Copy link
Member

bpasero commented Aug 11, 2018

@lediur if you have the time could you see if VSCode Exploration also looks good to you in terms of colors? It includes a variant of the fix on a newer Electron version that should restore the old behaviour completely.

bpasero added a commit that referenced this issue Aug 13, 2018
* update to Electron 2.0.7

* disable ColorCorrectRendering (for #51791)
@bpasero
Copy link
Member

bpasero commented Aug 21, 2018

Closing, with the update to 2.0.7 we are back to the Electron 1.7.x behaviour.

@bpasero bpasero closed this as completed Aug 21, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality workbench-electron Electron-VS Code issues
Projects
None yet
Development

No branches or pull requests

5 participants