Created
April 8, 2014 12:35
-
-
Save bodinsamuel/10117603 to your computer and use it in GitHub Desktop.
JS: Array of Color to Console
This file contains 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
// When you have an array of color (in themes or whatever) | |
// You want to know whatit will display, but it's very boring to copy/paste in a color picker. | |
var color_array_to_console = function(array) { | |
console.log(array, 'There is ', array.length, ' colors'); | |
for(var i = 0; i < array.length; i++) | |
console.log("%c███ " + array[i], "color: " + array[i] + ";"); | |
}; | |
color_array_to_console([ | |
'#058DC7','#ED561B','#e256ae','#E34A33','#e2cf56','#e25668', | |
'#e28956','#2CA25F','#56aee2' | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment