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
feat: systemPreferences.getColor
should return RGBA instead of RGB
#38960
Conversation
💖 Thanks for opening this pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not settled that this kind of change should be a fix
in #26628. The PR #30055 that changed getSystemColor
to return RGBA was a fix
because the document stated the API returned RGBA but the code did not.
Having said that I do think it is fine to mark this change as fix
though, but it should be @electron/wg-api to decide.
Also the return value should also be changed on Windows/Linux too, even if those platforms do not use transparent colors we should still fill the value with a FF
alpha value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
I agree with @zcbenz that the alpha channel FF
should be added for consistency.
API LGTM +1 for including |
@ILikeTeaALot can you address @zcbenz's concerns? |
@jkleinsc Happy to! Apologies I didn't see the activity on this PR. The Windows version should work exactly the same now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
systemPreferences.getColor
to return RGBA instead of RGBsystemPreferences.getColor
should return RGBA instead of RGB
systemPreferences.getColor
should return RGBA instead of RGBsystemPreferences.getColor
should return RGBA instead of RGB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Congrats on merging your first pull request! 🎉🎉🎉 |
Release Notes Persisted
|
…lectron#38960) * fix: return RGBA hex value from `SystemPreferences.getColor` * docs: update docs to match changes of last commit * fix: GetColor on windows now returns RGBA too * fix: update tests for getColor RGBA on Windows --------- Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Description of Change
Fully completes #26628
This fix implements the change requested in #26628, as stated there due to low usage of the API and the fact that returning a hex colour with alpha appended to the end should not cause any breaking changes, this is not marked as breaking.
(I don't have a recent-enough Mac to compile the code, so I would be immensely greatful for someone to take the time to do the necessary tests.)
The same change has not been made to the Windows version as no Windows system colour use alpha, however it could easily be changed as well for consistency.
Checklist
npm test
passesNo test changes are necessary, but as noted above I've been unable to run them myself.
Release Notes
Notes: Changed
systemPreferences.getColor(name)
to return an RGBA hex value (#RRGGBBAA
) instead of a plain RGB (#RRGGBB
) value.