mirror of
https://github.com/penpot/penpot.git
synced 2025-02-18 21:06:11 -05:00
🔥 Remove unused code related to remap colors of fo-text component
This commit is contained in:
parent
a37c1f7fca
commit
10bb75c1a1
2 changed files with 1 additions and 28 deletions
|
@ -11,10 +11,6 @@
|
||||||
(def render-ctx (mf/create-context nil))
|
(def render-ctx (mf/create-context nil))
|
||||||
(def def-ctx (mf/create-context false))
|
(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-route (mf/create-context nil))
|
||||||
(def current-profile (mf/create-context nil))
|
(def current-profile (mf/create-context nil))
|
||||||
(def current-team-id (mf/create-context nil))
|
(def current-team-id (mf/create-context nil))
|
||||||
|
|
|
@ -91,23 +91,6 @@
|
||||||
(recur (uc/next-rgb current-rgb))
|
(recur (uc/next-rgb current-rgb))
|
||||||
current-hex))))
|
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
|
(defn- fill->color
|
||||||
"Given a content node returns the information about that node fill color"
|
"Given a content node returns the information about that node fill color"
|
||||||
[{:keys [fill-color fill-opacity fill-color-gradient]}]
|
[{:keys [fill-color fill-opacity fill-color-gradient]}]
|
||||||
|
@ -199,13 +182,7 @@
|
||||||
;; We add 8px to add a padding for the exporter
|
;; We add 8px to add a padding for the exporter
|
||||||
;; width (+ width 8)
|
;; width (+ width 8)
|
||||||
|
|
||||||
[colors color-mapping color-mapping-inverse] (retrieve-colors shape)
|
[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))]
|
|
||||||
|
|
||||||
[:foreignObject
|
[:foreignObject
|
||||||
{:x x
|
{:x x
|
||||||
|
|
Loading…
Add table
Reference in a new issue