Last active
May 3, 2019 15:16
-
-
Save zackshapiro/8f0ee1579c68956d40d422ca2f81fbb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var num2hex = rgb => { | |
return rgb | |
.map(color => { | |
let str = color.toString(16); | |
if (str.length === 1) { | |
str = '0' + str; | |
} | |
return str; | |
}) | |
.join(''); | |
}; | |
var rgb = [100, 0, 0]; | |
var colors = ['red', 'green', 'blue']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment