#47660: fix: default to system accent color on invalid user color
Merged
Description of Change
Fixes an issue where an invalid color passed as a string to accentColor
would result in a white accent color. This happened because our ParseCSSColor
utility falls back to white on parse failure. When a user passes an invalid string we should instead fall back to system color.
This fixes that by reworking our ParseCSSColor
utility to return an optional value and leaving it up to the callers to decide their fallback color.
cc @bpasero
Checklist
- PR description included and stakeholders cc'd
-
npm test
passes - PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Fixes an issue where an invalid color passed as a string to accentColor
would result in a white accent color.
Backports
36-x-y
PendingWaiting for a manual backport
37-x-y
PendingWaiting for a manual backport
38-x-y
MergedPR Number
#47684Merged At
Jul 8, 2025, 8:21:44 AM
Released In
v38.0.0-alpha.5Release Date
Jul 10, 2025, 8:31:24 AM
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron