codebytere

#47660: fix: default to system accent color on invalid user color

Merged
Created: Jul 3, 2025, 1:36:10 PM
Merged: Jul 8, 2025, 4:15:13 AM
4 comments
Target: main

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

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
Pending
Waiting for a manual backport
37-x-y
Pending
Waiting for a manual backport
38-x-y
Merged
PR Number
#47684
Merged At
Jul 8, 2025, 8:21:44 AM
Released In
v38.0.0-alpha.5
Release 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