mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 15:57:26 +02:00
🎉 New colorpicker
This commit is contained in:
parent
4e694ff194
commit
12a2b35b28
4 changed files with 428 additions and 5 deletions
|
@ -52,6 +52,20 @@
|
|||
(-> (hex->rgb data)
|
||||
(conj opacity)))
|
||||
|
||||
(defn hex->hsl [hex]
|
||||
(try
|
||||
(into [] (gcolor/hexToHsl hex))
|
||||
(catch :default e (do
|
||||
(.log js/console e)
|
||||
[0 0 0]))))
|
||||
|
||||
(defn hsl->rgb
|
||||
[h s l]
|
||||
(gcolor/hslToRgb h s l))
|
||||
|
||||
(defn hsl->hex [h s l]
|
||||
(gcolor/hslToHex h s l))
|
||||
|
||||
(defn hex?
|
||||
[v]
|
||||
(and (string? v)
|
||||
|
|
|
@ -203,3 +203,6 @@
|
|||
[b]
|
||||
{:pre [(blob? b)]}
|
||||
(js/URL.createObjectURL b))
|
||||
|
||||
(defn set-css-property [node property value]
|
||||
(.setProperty (.-style node) property value))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue