From c6775bae20537e03a8b76560cb69646529c925c2 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 2 Nov 2024 19:29:15 +0100 Subject: [PATCH] Fixed having invalid custom gradient colors --- src/ZenGradientGenerator.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ZenGradientGenerator.mjs b/src/ZenGradientGenerator.mjs index 807ec33..03e8cd2 100644 --- a/src/ZenGradientGenerator.mjs +++ b/src/ZenGradientGenerator.mjs @@ -288,7 +288,7 @@ async addCustomColor() { const color = this.customColorInput.value; - if (!color || !color.match(/^#[0-9a-f]{3,6}$/i)) { + if (!color || !color.match(/^#[0-9a-f]{3,8}$/i)) { return; } // can be any color format, we just add it to the list as a dot, but hidden @@ -461,6 +461,9 @@ // get the theme from the window workspaceTheme = theme || windowWorkspace.theme; + workspaceTheme.gradientColors = workspaceTheme.gradientColors.filter(color => + color.isCustom ? color.c.match(/^#[0-9a-f]{3,8}$/i) : true + ); const appWrapper = browser.document.getElementById('zen-main-app-wrapper'); if (!skipUpdate) {