From 48a8b1bc553920420617f453451bce15742790eb Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Wed, 18 Sep 2024 11:30:32 +0200 Subject: [PATCH] Fix color updating --- frontend/src/app/main/ui/workspace/tokens/changes.cljs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/changes.cljs b/frontend/src/app/main/ui/workspace/tokens/changes.cljs index 57d09f703..e1438da95 100644 --- a/frontend/src/app/main/ui/workspace/tokens/changes.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/changes.cljs @@ -19,7 +19,8 @@ [app.main.ui.workspace.tokens.token :as wtt] [beicon.v2.core :as rx] [clojure.set :as set] - [potok.v2.core :as ptk])) + [potok.v2.core :as ptk] + [app.main.ui.workspace.tokens.tinycolor :as tinycolor])) ;; Token Updates --------------------------------------------------------------- @@ -126,7 +127,11 @@ (defn update-color [value shape-ids] - (wdc/change-fill shape-ids {:color (str "#" value)} 0)) + (let [color (some->> value + (tinycolor/valid-color) + (tinycolor/->hex) + (str "#"))] + (wdc/change-fill shape-ids {:color color} 0))) (defn update-shape-dimensions [value shape-ids attributes] (ptk/reify ::update-shape-dimensions