feat: Accent color will now use the system accent color, b=no-bug, c=common, workspaces

This commit is contained in:
Mr. M
2025-08-31 17:33:05 +02:00
parent ae66e66aa8
commit 52a399f0ed
5 changed files with 24 additions and 5 deletions

View File

@@ -1501,7 +1501,16 @@
getNativeAccentColor() {
const accentColor = Services.prefs.getStringPref('zen.theme.accent-color');
const rgb = this.hexToRgb(accentColor);
let rgb;
if (accentColor.startsWith('system')) {
const rawRgb = window.getComputedStyle(document.getElementById('zen-browser-background'))[
'color'
];
Services.prefs.setStringPref('zen.theme.accent-color', `system:${rawRgb}`);
rgb = rawRgb.match(/\d+/g).map(Number);
} else {
rgb = this.hexToRgb(accentColor);
}
if (this.isDarkMode) {
// If the theme is dark, we want to use a lighter color
return this.blendColors(rgb, [0, 0, 0], 40);