mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 16:46:37 +02:00
Merge pull request #4540 from penpot/azazeln28-fix-color-palette-sorting-by-hue-and-value
🐛 Color palette sorting
This commit is contained in:
commit
c616e3c932
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