Skip to content

Instantly share code, notes, and snippets.

@idmontie
Created July 27, 2015 18:37
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 idmontie/3fbe5f415aa163397792 to your computer and use it in GitHub Desktop.
Save idmontie/3fbe5f415aa163397792 to your computer and use it in GitHub Desktop.
Few color swatches
#swatches .swatch {
float:left;
width:100px;
height:100px;
}
<div id="swatches"></div>
// Your colors go in a.
var a = `
#903 ,
#d23153 ,
#008ed6 ,
#568e14 ,
#f47c00 ,
#f0ad4e ,
#ffc425 ,
#ffb310 ,
#ffb204 ,
#4f5557 ,
#000 ,
#1e1e1e ,
#1f1f1f ,
#2a2a2a ,
#353535 ,
#414141 ,
#505050 ,
#595959 ,
#666 ,
#777 ,
#7f7f7f ,
#828282 ,
#999 ,
#a9a9a9 ,
#b0b0b0 ,
#b7b7b7 ,
#ccc ,
#dbdbdb ,
#e5e5e5 ,
#ededed ,
#f1f1f1 ,
#f5f5f5 ,
#fafafa ,
`;
var colors = a.split(',').map(function (s) { return s.trim() } );
colors.map( function print(s) {
$('#swatches').append('<div class="swatch" style="background-color:' + s + '"></div>');
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment