diff --git a/frontend/src/app/main/ui/context.cljs b/frontend/src/app/main/ui/context.cljs index 315324668..ee4c891e4 100644 --- a/frontend/src/app/main/ui/context.cljs +++ b/frontend/src/app/main/ui/context.cljs @@ -11,10 +11,6 @@ (def render-ctx (mf/create-context nil)) (def def-ctx (mf/create-context false)) -;; This content is used to replace complex colors to simple ones -;; for text shapes in the export process -(def text-plain-colors-ctx (mf/create-context false)) - (def current-route (mf/create-context nil)) (def current-profile (mf/create-context nil)) (def current-team-id (mf/create-context nil)) diff --git a/frontend/src/app/main/ui/shapes/text/fo_text.cljs b/frontend/src/app/main/ui/shapes/text/fo_text.cljs index 158b6c117..b32f9c876 100644 --- a/frontend/src/app/main/ui/shapes/text/fo_text.cljs +++ b/frontend/src/app/main/ui/shapes/text/fo_text.cljs @@ -91,23 +91,6 @@ (recur (uc/next-rgb current-rgb)) current-hex)))) -(defn- remap-colors - "Returns a new content replacing the original colors by their mapped 'simple color'" - [content color-mapping] - - (cond-> content - (and (:fill-opacity content) (< (:fill-opacity content) 1.0)) - (-> (assoc :fill-color (get color-mapping [(:fill-color content) (:fill-opacity content)])) - (assoc :fill-opacity 1.0)) - - (some? (:fill-color-gradient content)) - (-> (assoc :fill-color (get color-mapping (:fill-color-gradient content))) - (assoc :fill-opacity 1.0) - (dissoc :fill-color-gradient)) - - (contains? content :children) - (update :children #(mapv (fn [node] (remap-colors node color-mapping)) %)))) - (defn- fill->color "Given a content node returns the information about that node fill color" [{:keys [fill-color fill-opacity fill-color-gradient]}] @@ -199,13 +182,7 @@ ;; We add 8px to add a padding for the exporter ;; width (+ width 8) - [colors color-mapping color-mapping-inverse] (retrieve-colors shape) - - plain-colors? (mf/use-ctx muc/text-plain-colors-ctx) - - content (cond-> content - plain-colors? - (remap-colors color-mapping))] + [colors color-mapping color-mapping-inverse] (retrieve-colors shape)] [:foreignObject {:x x