mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-26 16:31:30 +00:00
feat: Accent color will now use the system accent color, b=no-bug, c=common, workspaces
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user