Skip to content

Instantly share code, notes, and snippets.

@akinozgen
Created November 16, 2021 16:54
Show Gist options
  • Save akinozgen/cc37865d7b6e7ad7bfc468bf931e1ddd to your computer and use it in GitHub Desktop.
Save akinozgen/cc37865d7b6e7ad7bfc468bf931e1ddd to your computer and use it in GitHub Desktop.
random colors js
function randomColors(count) {
const colors = ['#071E22', '#1D7874', '#679289', '#F4C095', '#EE2E31', '#423E3B', '#FF2E00', '#FEA82F', '#FFFECB', '#5448C8'];
const selected = [];
for (var i = count - 1; i >= 0; i--) {
selected.push(colors[ Math.floor(Math.random()*colors.length) ]);
}
return selected;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment