const generateColorPalette = (numColors) => {
const baseColors = [
'hsl(0, 70%, 50%)',
'hsl(240, 70%, 50%)',
'hsl(60, 70%, 50%)',
'hsl(120, 70%, 40%)',
'hsl(300, 70%, 50%)',
'hsl(30, 70%, 50%)',
'hsl(180, 70%, 40%)',
'hsl(210, 70%, 50%)',
];
const colors = [];
for (let i = 0; i < numColors; i++) {
const baseColor = baseColors[i % baseColors.length];
const lightnessVariation = 10 * Math.floor(i / baseColors.length);
const color = baseColor.replace(/(\d+%)\)/, `${40 + lightnessVariation}%)`);
colors.push(color);
}
return colors;
};
const generateColorPalette = numColors => {
const colors = []
const saturation = 60
const lightness = 40
for (let i = 0; i < numColors; i++) {
const hue = (i * (360 / numColors)) % 360
colors.push(`hsl(${hue}, ${saturation}%, ${lightness}%)`)
}
return colors
}