Electron and Webkit browsers display wrong colors

I am developing an app using Electron. I have a color in Adobe XD, for example, rgb(0,55,200). When I set this color in my app, Electron display a different color: rgb(4,48,193).

Electron with wrong values
7Vxvs

The same happens in Safari and Chrome, but Firefox display the correct value. Even stranger is that Visual Studio Code, an app using Electron, display the correct value (I opened the devtools inside vscode, and checked) So there must be a way of a configuration option to display correct values in Electron.

I thought that it could be my Electron version. Vscode process.versions.electron was 11.3.0 and mine was 11.2.1. I updated to 11.4.4 and still the same.

I tried in another computer and the colors are off by a different factor.

Something very strange that happened with Electron 11.2.1 is that while the colors are off in the site, when pointing the color picker to the little color box inside devtools, the color is correct. You can see this box in the second screenshot, but the screenshot is from version 11.4.4 which does not have this odd behavior.

I tried all this flags together with no luck:

app.commandLine.appendSwitch('force-color-profile', 'srgb');
app.commandLine.appendSwitch('--disable-color-correct-rendering');
app.commandLine.appendSwitch('disable-features', 'ColorCorrectRendering');
app.commandLine.appendSwitch('disable-color-correct-rendering');
app.commandLine.appendSwitch('enable-color-correct-rendering', 'disabled');
app.commandLine.appendSwitch('--enable-color-correct-rendering=disabled');
app.commandLine.appendSwitch('--enable-color-correct-rendering', 'disabled');
app.commandLine.appendArgument('--enable-color-correct-rendering=disabled');

This is not a problem with Monitor Color Profiles

If I change the color picker mode to sRGB, the Electron colors are almost right, but the Adobe XD colors are completely off. If I change my monitor color profile to sRGB, everything is correct. But this is not a solution, since I can not ask the user of my app to change her/his color profile. And also, Firefox and vscode are working just fine. There must be a solution.

Any advice is welcome.

Thanks for reading!

  • 1

  • Make sure your system is up-to-par

That means All updates on your preferred platform…

  • 2nd :smile: be sure and test everything in Adobe Acrobat. Power Shell is not very helpful unless you are executing server side data base files or using an encryption method.
    3rd be sure and toggle off any inverted color swatches. Widgets behave very similar to color wheels, palattes and bucket groups i.e. snippets.

  • Last but not least avoid grouping font family. Sensitive bytes of data not only depend on them but can alter contents within shared or public folders.

  • Further questions message me @back

I made a simple test to reproduce the problem:

package.json

{
	"name": "electron-colors",
	"version": "0.0.1",
	"description": "Test Wrong Colors in Eletron.",
	"main": "main.js",
	"scripts": {
		"start": "electron ."
	},
	"repository": "",
	"author": "Yuzem",
	"license": "BSD",
	"dependencies": {},
	"devDependencies": {
		"electron": "^11.2.1"
	}
}

main.js

const {app, BrowserWindow} = require('electron');

app.on('ready', () => {
	new BrowserWindow().loadFile('./index.html');
});

index.html

<html>
	<head>
		<title>Test Electron Colors</title>
	</head>
	<body style="background-color: rgb(0,55,200); color:white">
		<h1>This blue color should be: rgb(0,55,200)</h1>
	</body>
</html>

Run with:

npm install
npm start

Important!
The difference in colors happens in Safari, Chrome and Electron but not in Firefox.
Visual Studio Code, an app made in Electron, does not have this problem. Therefore, there must be a way to make it work in Electron.

Consider using base.js for do and parse it inside of rb file/path_folder.venv (tty-require+wr touch md5 for bmp sr
Bc ** RGB col | &
or case sensitive #
initial run \com $spec …^ re.log
as safari does not require an includes location upon runtime : vbasic or xcsv in the lite version your running on the machine. in i

  • g

an fgrep to rep.vscr ~.TAR
::dba

Hi, Corserp. Sorry, but I don’t understand a thing of what you are saying.
Can anyone reproduce this error? I test it in two different computers.