Skip to content

Instantly share code, notes, and snippets.

@vorce
Created Jun 10, 2013
Embed
What would you like to do?
hex-to-rgb
(defn hex-to-rgb
"Convert hex strings to rgb list. Ex: 'FF0000' -> (255 0 0)"
[hex]
(let [ hex-pairs (partition 2 hex) ]
(for [p hex-pairs]
(java.lang.Integer/parseInt (apply str p) 16))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment