Created
October 28, 2019 17:07
-
-
Save trv469/1554de1520b37015140d13ca80bef353 to your computer and use it in GitHub Desktop.
Generar color hexadecimal en JavaScript
This file contains hidden or 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
| const getRandomColor = () => { | |
| let letters = "0123456789ABCDEF"; | |
| let color = "#"; | |
| for (let i = 0; i < 6; i++) { | |
| color += letters[Math.floor(Math.random() * 16)]; | |
| } | |
| return color; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment