Skip to content

Instantly share code, notes, and snippets.

@vorce
Created June 10, 2013 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vorce/5748534 to your computer and use it in GitHub Desktop.
Save vorce/5748534 to your computer and use it in GitHub Desktop.
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