mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 22:22:43 -05:00
Fix color updating
This commit is contained in:
parent
c007170603
commit
48a8b1bc55
1 changed files with 7 additions and 2 deletions
|
@ -19,7 +19,8 @@
|
||||||
[app.main.ui.workspace.tokens.token :as wtt]
|
[app.main.ui.workspace.tokens.token :as wtt]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[potok.v2.core :as ptk]))
|
[potok.v2.core :as ptk]
|
||||||
|
[app.main.ui.workspace.tokens.tinycolor :as tinycolor]))
|
||||||
|
|
||||||
;; Token Updates ---------------------------------------------------------------
|
;; Token Updates ---------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -126,7 +127,11 @@
|
||||||
|
|
||||||
(defn update-color
|
(defn update-color
|
||||||
[value shape-ids]
|
[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]
|
(defn update-shape-dimensions [value shape-ids attributes]
|
||||||
(ptk/reify ::update-shape-dimensions
|
(ptk/reify ::update-shape-dimensions
|
||||||
|
|
Loading…
Add table
Reference in a new issue