mirror of
https://github.com/penpot/penpot.git
synced 2025-07-27 03:17:19 +02:00
🐛 color palette sorting
This commit is contained in:
parent
857429290d
commit
a8fae53564
2 changed files with 24 additions and 7 deletions
|
@ -54,13 +54,7 @@
|
|||
get-sorted-colors
|
||||
(mf/use-fn
|
||||
(fn [colors]
|
||||
(sort (fn [a b]
|
||||
(let [[ah _ al] (c/hex->hsl (:color a))
|
||||
[bh _ bl] (c/hex->hsl (:color b))
|
||||
a (+ (* ah 100) (* al 99))
|
||||
b (+ (* bh 100) (* bl 99))]
|
||||
(compare a b)))
|
||||
(into [] (filter check-valid-color?) colors))))
|
||||
(sort c/sort-colors (into [] (filter check-valid-color?) colors))))
|
||||
|
||||
toggle-palette
|
||||
(mf/use-fn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue