Skip to content

Commit f647df6

Browse files
author
Benjamin Pasero
committed
electron - allow to configure color profile for microsoft#88491
1 parent 8999159 commit f647df6

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/main.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,12 @@ function configureCommandlineSwitchesSync(cliArgs) {
131131
'disable-hardware-acceleration',
132132

133133
// provided by Electron
134-
'disable-color-correct-rendering'
134+
'disable-color-correct-rendering',
135+
136+
// override for the color profile to use
137+
'force-color-profile'
135138
];
139+
136140
if (process.platform === 'linux') {
137141
SUPPORTED_ELECTRON_SWITCHES.push('force-renderer-accessibility');
138142
}
@@ -147,7 +151,16 @@ function configureCommandlineSwitchesSync(cliArgs) {
147151
}
148152

149153
const argvValue = argvConfig[argvKey];
150-
if (argvValue === true || argvValue === 'true') {
154+
155+
// Color profile
156+
if (argvKey === 'force-color-profile') {
157+
if (argvValue) {
158+
app.commandLine.appendSwitch(argvKey, argvValue);
159+
}
160+
}
161+
162+
// Others
163+
else if (argvValue === true || argvValue === 'true') {
151164
if (argvKey === 'disable-hardware-acceleration') {
152165
app.disableHardwareAcceleration(); // needs to be called explicitly
153166
} else {

src/vs/workbench/electron-browser/desktop.contribution.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema';
341341
'disable-color-correct-rendering': {
342342
type: 'boolean',
343343
description: nls.localize('argv.disableColorCorrectRendering', 'Resolves issues around color profile selection. ONLY change this option if you encounter graphic issues.')
344+
},
345+
'force-color-profile': {
346+
type: 'string',
347+
markdownDescription: nls.localize('argv.forceColorProfile', 'Allows to override the color profile to use. If you experience colors appear badly, try to set this to `srgb` and restart.')
344348
}
345349
}
346350
};

0 commit comments

Comments
 (0)