mirror of
https://github.com/penpot/penpot.git
synced 2026-09-07 20:49:37 +00:00
Add stroke colors into recent colors summary.
This commit is contained in:
parent
3fbe465b99
commit
9e72dbb0a0
@ -26,16 +26,20 @@
|
|||||||
#(rs/emit! (dw/toggle-tool :workspace/colorpalette)))
|
#(rs/emit! (dw/toggle-tool :workspace/colorpalette)))
|
||||||
|
|
||||||
(defn- count-color
|
(defn- count-color
|
||||||
[state shape]
|
[state shape prop]
|
||||||
(let [color (:fill shape)]
|
(let [color (prop shape)]
|
||||||
(if (contains? state color)
|
(if (contains? state color)
|
||||||
(update state color inc)
|
(update state color inc)
|
||||||
(assoc state color 1))))
|
(assoc state color 1))))
|
||||||
|
|
||||||
(defn- calculate-colors
|
(defn- calculate-colors
|
||||||
[shapes]
|
[shapes]
|
||||||
(let [result (reduce count-color {} shapes)]
|
(as-> (comp
|
||||||
(take 5 (map first (sort-by second (into [] result))))))
|
#(count-color %1 %2 :fill)
|
||||||
|
#(count-color %1 %2 :stroke)) $
|
||||||
|
(reduce $ {} shapes)
|
||||||
|
(sort-by second (into [] $))
|
||||||
|
(take 5 (map first $))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Component
|
;; Component
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user