mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 10:38:13 -05:00
🐛 Fixes error with colorpicker
This commit is contained in:
parent
147ccd176a
commit
a4bb162090
2 changed files with 11 additions and 10 deletions
|
@ -99,6 +99,5 @@
|
|||
(mf/defc modal
|
||||
[]
|
||||
(let [modal (mf/deref modal-ref)]
|
||||
(println "modal" modal)
|
||||
(when modal [:& modal-wrapper {:data modal
|
||||
:key (:id modal)}])))
|
||||
|
|
|
@ -101,10 +101,12 @@
|
|||
(let [value (if (uc/hex? value) value "#000000")
|
||||
[r g b] (uc/hex->rgb value)
|
||||
[h s v] (uc/hex->hsv value)]
|
||||
|
||||
{:hex (or value "000000")
|
||||
:alpha (or opacity 1)
|
||||
:r r :g g :b b
|
||||
:h h :s s :v v}))
|
||||
:h h :s s :v v}
|
||||
))
|
||||
|
||||
(mf/defc colorpicker
|
||||
[{:keys [value opacity on-change on-accept]}]
|
||||
|
@ -182,7 +184,7 @@
|
|||
(mf/use-effect
|
||||
(mf/deps picking-color? picked-color)
|
||||
(fn [] (when picking-color?
|
||||
(let [[r g b] picked-color
|
||||
(let [[r g b] (or picked-color [0 0 0])
|
||||
hex (uc/rgb->hex [r g b])
|
||||
[h s v] (uc/hex->hsv hex)]
|
||||
(swap! current-color assoc
|
||||
|
|
Loading…
Add table
Reference in a new issue