mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:29:59 +02:00
Refactor ZenGradientGenerator.mjs to adjust color handling based on dark mode and improve workspace integration
This commit is contained in:
parent
8ecd316c18
commit
99003f3cb5
1 changed files with 7 additions and 2 deletions
|
@ -439,7 +439,7 @@
|
|||
}
|
||||
}
|
||||
const result = this.pSBC(
|
||||
this.isDarkMode ? 0.7 : -0.7,
|
||||
this.isDarkMode ? 0.5 : -0.5,
|
||||
`rgb(${dominantColor[0]}, ${dominantColor[1]}, ${dominantColor[2]})`);
|
||||
return result?.match(/\d+/g).map(Number);
|
||||
}
|
||||
|
@ -478,13 +478,14 @@
|
|||
|
||||
browser.gZenThemePicker.resetCustomColorList();
|
||||
if (!workspaceTheme || workspaceTheme.type !== 'gradient') {
|
||||
browser.document.body.style.removeProperty('--zen-main-browser-background');
|
||||
browser.document.documentElement.style.removeProperty('--zen-main-browser-background');
|
||||
browser.gZenThemePicker.updateNoise(0);
|
||||
if (!skipUpdate) {
|
||||
for (const dot of browser.gZenThemePicker.panel.querySelectorAll('.zen-theme-picker-dot')) {
|
||||
dot.remove();
|
||||
}
|
||||
}
|
||||
browser.document.documentElement.style.setProperty('--zen-primary-color', this.getNativeAccentColor());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -520,6 +521,10 @@
|
|||
});
|
||||
}
|
||||
|
||||
getNativeAccentColor() {
|
||||
return Services.prefs.getStringPref('zen.theme.accent-color');
|
||||
}
|
||||
|
||||
resetCustomColorList() {
|
||||
this.customColorList.innerHTML = '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue