Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var colors = [
- 'rgb(30, 210, 82)',
- 'rgb(173, 0, 148)',
- 'rgb(247, 223, 12)',
- 'rgb(242, 0, 58)',
- 'rgb(95, 100, 224)',
- 'rgb(14, 0, 225)',
- 'rgb(43, 200, 222)',
- 'rgb(214, 46, 20)',
- 'rgb(250, 0, 6)',
- 'rgb(81, 145, 151)',
- 'rgb(31, 229, 21)',
- 'rgb(102, 213, 105)',
- 'rgb(249, 155, 25)',
- 'rgb(75, 0, 104)',
- 'rgb(21, 61, 119)'
- ];
- // for each color
- for(var i = 0; i < colors.length; i++) {
- // create a div
- var div = document.createElement("div");
- // and give it a corresonpding color from our pallete
- div.style.background = colors[i];
- // and append it to the page
- document.body.appendChild(div);
- }
Add Comment
Please, Sign In to add comment