mirror of
https://github.com/penpot/penpot.git
synced 2025-07-13 23:27:16 +02:00
🐛 Fix gradient colors in recents
This commit is contained in:
parent
199142045f
commit
4961991e18
2 changed files with 9 additions and 5 deletions
|
@ -13,6 +13,7 @@
|
||||||
[app.main.data.modal :as md]
|
[app.main.data.modal :as md]
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.layout :as layout]
|
[app.main.data.workspace.layout :as layout]
|
||||||
|
[app.main.data.workspace.libraries :as dwl]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.texts :as dwt]
|
[app.main.data.workspace.texts :as dwt]
|
||||||
[app.util.color :as uc]
|
[app.util.color :as uc]
|
||||||
|
@ -487,7 +488,7 @@
|
||||||
(dissoc :stops)))))))))
|
(dissoc :stops)))))))))
|
||||||
|
|
||||||
(defn update-colorpicker-color
|
(defn update-colorpicker-color
|
||||||
[changes]
|
[changes add-recent?]
|
||||||
(ptk/reify ::update-colorpicker-color
|
(ptk/reify ::update-colorpicker-color
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
@ -502,7 +503,12 @@
|
||||||
(materialize-color-components))))
|
(materialize-color-components))))
|
||||||
(-> state
|
(-> state
|
||||||
(assoc :type :color)
|
(assoc :type :color)
|
||||||
(dissoc :gradient :stops :editing-stop)))))))))
|
(dissoc :gradient :stops :editing-stop)))))))
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [_ state _]
|
||||||
|
(when add-recent?
|
||||||
|
(let [formated-color (get-color-from-colorpicker-state (:colorpicker state))]
|
||||||
|
(rx/of (dwl/add-recent-color formated-color)))))))
|
||||||
|
|
||||||
(defn update-colorpicker-gradient
|
(defn update-colorpicker-gradient
|
||||||
[changes]
|
[changes]
|
||||||
|
|
|
@ -69,9 +69,7 @@
|
||||||
(fn [color]
|
(fn [color]
|
||||||
(let [recent-color (merge current-color color)
|
(let [recent-color (merge current-color color)
|
||||||
recent-color (dc/materialize-color-components recent-color)]
|
recent-color (dc/materialize-color-components recent-color)]
|
||||||
(when (not @drag?)
|
(st/emit! (dc/update-colorpicker-color recent-color (not @drag?))))))
|
||||||
(st/emit! (dwl/add-recent-color recent-color)))
|
|
||||||
(st/emit! (dc/update-colorpicker-color color)))))
|
|
||||||
|
|
||||||
handle-click-picker
|
handle-click-picker
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue