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
systemPreferences.getAccentColor returns wrong color if automatic color is selected in windows 10 #16545
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
ok.. so.. after some more digging i went into source and found the 2 registry keys electron uses to get those colors so i made a scirpt to go in and check the registry manualy and display the output againt electrons. code: const regedit = require('regedit')
const ipcRenderer = require('electron').ipcRenderer
ipcRenderer.on('dom-color', (event, color) => { go(color) })
function go(color) {
regedit.list('HKCU\\Software\\Microsoft\\Windows\\DWM', function(err, result) {
result = result['HKCU\\Software\\Microsoft\\Windows\\DWM'].values
console.log('AccentColor', result.AccentColor.value, toHex(result.AccentColor.value))
console.log('ColorizationColor', result.ColorizationColor.value, toHex(result.ColorizationColor.value))
document.getElementById('AccentColor').style.backgroundColor = `#${toHex(result.AccentColor.value).substring(2)}`
document.getElementById('ColorizationColor').style.backgroundColor = `#${toHex(result.ColorizationColor.value).substring(2)}`
document.getElementById('getAccentColor').style.backgroundColor = `#${color}`
})
} |
Thank you for taking the time to report this issue and helping to make Electron better. The version of Electron you reported this on has been superseded by newer releases. If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know. I'm setting the Thanks in advance! Your help is appreciated. |
Thank you for your issue! We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue. |
node_modules/.bin/electron --version
: v4.0.2(Platform and Version): Windows 10: Version 1809 (Build: 17763.253)
Expected Behavior
calling
systemPreferences.getAccentColor()
should return correct color no matter if automatic color is set in windowsActual behavior
if using
systemPreferences.on('accent-color-changed')
when moving from manual color to automatic the event will fire twice, once with the correct color and immidiatly after with a diffrent color (which is diffrent depending on the pc not sure what causes the second color to be picked)if
systemPreferences.getAccentColor()
is also called after this event from now on it will return the incorrect valueTo Reproduce
in main.js
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
Screenshots
http://mei.is-a-good-waifu.com/233eba.mp4
video showing the issue in action
Additional Information
note: starting the application with automatic already set still returns incorrect color values
The text was updated successfully, but these errors were encountered: