From 2cea7405b58631fa1e5a9855347e4b32177ed610 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 26 Apr 2021 12:54:16 +0200 Subject: [PATCH] :bug: Allow use library colors when defining gradients --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/colorpicker.cljs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 85b71fde9..c95b5e2ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -35,6 +35,7 @@ - Fix problem when opening the context menu in dashboard at the bottom [#856](https://github.com/penpot/penpot/issues/856) - Fix visual problem with group invite [Taiga #1290](https://tree.taiga.io/project/penpot/issue/1290) - Fix issues with promote owner panel [Taiga #763](https://tree.taiga.io/project/penpot/issue/763) +- Allow use library colors when defining gradients [Taiga #1614](https://tree.taiga.io/project/penpot/issue/1614) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index f1ca966e0..993c1cdc8 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -164,8 +164,12 @@ on-select-library-color (fn [color] - (reset! state (data->state color)) - (on-change color)) + (let [editing-stop (:editing-stop @state) + is-gradient? (some? (:gradient color))] + (if (and (some? editing-stop) (not is-gradient?)) + (handle-change-color (color->components (:color color) (:opacity color))) + (do (reset! state (data->state color)) + (on-change color))))) on-add-library-color (fn [color]