I have the following method
export const generateRandomColor = () => {
const letters = "0123456789ABCDEF";
let color = "#";
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * letters.length)];
}
return color;
};
which generates random colors. I am using this function to get the colors of my PieChart, and definitely, it is not elegant at all to see colors of different types (light, dark, pastels...) mixed.
How can I only generate random PASTEL colors in JS (HEX or RGBA)?