public
Created

Convert hex color values to rgb clojure

  • Download Gist
css-colors
1 2 3 4 5 6
(defn css-color [color]
(let [ colors (rest (clojure.string/split color #""))
red (take 2 colors)
green (take 2 (drop 2 colors))
blue (take 2 (drop 4 colors))]
(map #(-> (conj % "0x") (clojure.string/join) (read-string)) [red green blue])))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.