Skip to content

Instantly share code, notes, and snippets.

@vanrez-nez
Last active Aug 29, 2015
Embed
What would you like to do?
Conversion from RGB values to Hex notation
function rgb2Hex(r, g, b) {
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).substr(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment