public
Created

toHexString = function (r, g, b)

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10
var toHexString = function (r, g, b) {
return (toHexString = _toHexString)(r,g,b);
function _toHexString(r, g, b) {
return "#" + toHexByte(r) + toHexByte(g) + toHexByte(b);
}
function toHexByte(bite) {
var hex = bite.toString(16);
return (hex.length === 2 ? hex : "0" + hex);
}
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.