Last active
October 19, 2022 13:54
-
-
Save benjamingwynn/077ae8841512473753f60b1cdf142b60 to your computer and use it in GitHub Desktop.
Generate a random hexadecimal colour in Javascript
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 generateRandomColour () { | |
return '#'+(Math.random() * 0xffffff | 0).toString(16).padStart(6, '0') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment