Created
November 16, 2021 16:54
-
-
Save akinozgen/cc37865d7b6e7ad7bfc468bf931e1ddd to your computer and use it in GitHub Desktop.
random colors js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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