console
const t = document.querySelector('#test')
const data = '#000000,#ffffff,#ff0000,#ffff00,#ff00ff,#0000ff,#00ffff,#00ff00,#fff591,#1B6AA5,#63b931,#f9a602,#118077,#660099,#7acfd6,#ff420e,#F5E5F0,#D5A253,#6b778d,#F43E71,#118DF0,#e6194B,#3cb44b,#ffe119,#4363d8,#f58231,#911eb4,#42d4f4,#f032e6,#bfef45,#fabed4,#469990,#dcbeff,#9A6324,#fffac8,#800000,#aaffc3,#808000,#ffd8b1,#000075,#a9a9a9';
data.split(',').forEach(item => {
const c1 = document.createElement('span');
c1.style.backgroundColor = item;
t.appendChild(c1);
});
<div id="test"></div>
span {
display: inline-block;
width: 100px;
height: 100px;
margin-right: 10px;
margin-bottom: 10px;
}