Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setShownPartColorScales(colorScale) {
const colors = document.getElementById('colors');
colors.innerHTML = '';
const partColors = partColorScales[colorScale];
const partNames = bodyPix.PART_CHANNELS;
for (let i = 0; i < partColors.length; i++) {
const partColor = partColors[i];
const child = document.createElement('li');
child.innerHTML = `
<div style="background-color:rgb(${partColor[0]},${
partColor[1]},${partColor[2]})" class="color"></div>
${partNames[i]}`;
colors.appendChild(child);
}
}