🐛 color palette sorting

This commit is contained in:
AzazelN28 2024-04-24 16:07:47 +02:00
parent 857429290d
commit a8fae53564
2 changed files with 24 additions and 7 deletions

View file

@ -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