mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 19:54:39 +00:00
fix palerColor with gradients
This commit is contained in:
+15
-1
@@ -20,6 +20,7 @@ export function updateAllColors(storedSetting, newColor = null) {
|
||||
|
||||
// Mode-based properties, applied if storedSetting is provided
|
||||
let modeProps = {};
|
||||
console.log(DarkMode);
|
||||
if (DarkMode !== null) {
|
||||
modeProps = DarkMode ? {
|
||||
"--background-primary": "#232323",
|
||||
@@ -29,10 +30,12 @@ export function updateAllColors(storedSetting, newColor = null) {
|
||||
"--background-primary": "#ffffff",
|
||||
"--background-secondary": "#e5e7eb",
|
||||
"--text-primary": "black",
|
||||
"--better-pale": lightenAndPaleColor(selectedColor) // Wrap this in try-catch if needed
|
||||
"--better-pale": lightenAndPaleColor(selectedColor)
|
||||
};
|
||||
}
|
||||
|
||||
console.log("modeProps:", modeProps);
|
||||
|
||||
// Dynamic properties, always applied
|
||||
const rgbThreshold = GetThresholdofHex(selectedColor);
|
||||
const isBright = rgbThreshold > 210;
|
||||
@@ -50,3 +53,14 @@ export function updateAllColors(storedSetting, newColor = null) {
|
||||
document.querySelector("link[rel*='icon']").href = getChromeURL("icons/icon-48.png");
|
||||
}
|
||||
}
|
||||
|
||||
export function getDarkMode() {
|
||||
return new Promise((resolve, reject) => {
|
||||
chrome.storage.local.get("DarkMode", (result) => {
|
||||
if (chrome.runtime.lastError) {
|
||||
return reject(chrome.runtime.lastError);
|
||||
}
|
||||
resolve(result.DarkMode);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user