Skip to content

Instantly share code, notes, and snippets.

@dhoko
Created March 8, 2013 10:25
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 dhoko/5115561 to your computer and use it in GitHub Desktop.
Save dhoko/5115561 to your computer and use it in GitHub Desktop.
RGB 2 HEX
var rgb2Hex = function(r) {
var t = "#", n = r.split("(")[1].split(")")[0].split(",");
t += parseInt(n[0]).toString(16) + parseInt(n[1]).toString(16) + parseInt(n[2]).toString(16);
return t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment