🐛 Allow select library colors on gradients

This commit is contained in:
alonso.torres 2024-02-21 16:46:28 +01:00 committed by Andrey Antukh
parent 764d15412f
commit ff88f30c74

View file

@ -159,9 +159,13 @@
on-select-library-color
(mf/use-fn
(mf/deps data handle-change-color)
(fn [_ color]
(st/emit! (dc/apply-color-from-colorpicker color))
(on-change color)))
(if (and (some? (:color color)) (some? (:gradient data)))
(handle-change-color {:hex (:color color) :alpha (:opacity color)})
(do
(st/emit! (dc/apply-color-from-colorpicker color))
(on-change color)))))
on-add-library-color
(mf/use-fn