Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Created January 5, 2020 13:50
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 ssaurel/26f116f2707905cf2275e85bd5bf64ac to your computer and use it in GitHub Desktop.
Save ssaurel/26f116f2707905cf2275e85bd5bf64ac to your computer and use it in GitHub Desktop.
toHex function for Hexadecimal Color Clock on the SSaurel's Blog
function toHex(d) {
var hex = ("0" + (Number(d).toString(16))).slice(-2).toUpperCase();
return hex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment