mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
add fallback colors for color functions in case of error
This commit is contained in:
@@ -15,6 +15,10 @@ function adjustLuminance(color: any, lum: any) {
|
||||
}
|
||||
|
||||
export default function ColorLuminance(color: any, lum = 0) {
|
||||
if (color == '' || color == null) {
|
||||
// light cyan blue
|
||||
return '#00bfff';
|
||||
}
|
||||
const colorRegex = /rgba?\(([^)]+)\)/gi; // Case-insensitive match for rgb() or rgba()
|
||||
|
||||
if (color.toLowerCase().includes('gradient')) {
|
||||
|
||||
@@ -18,7 +18,7 @@ let DarkMode: any = null;
|
||||
|
||||
export function updateAllColors(storedSetting: any, newColor = null) {
|
||||
// Determine the color to use
|
||||
const selectedColor = newColor || storedSetting.selectedColor;
|
||||
const selectedColor = newColor || storedSetting.selectedColor == '' ? '#007bff' : storedSetting.selectedColor;
|
||||
|
||||
if (storedSetting.transparencyEffects) {
|
||||
document.documentElement.classList.add('transparencyEffects');
|
||||
|
||||
Reference in New Issue
Block a user