Created
July 27, 2015 18:37
-
-
Save idmontie/3fbe5f415aa163397792 to your computer and use it in GitHub Desktop.
Few color swatches
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
#swatches .swatch { | |
float:left; | |
width:100px; | |
height:100px; | |
} |
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
<div id="swatches"></div> |
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
// 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