Created
January 6, 2020 15:34
-
-
Save YuukiToriyama/1e8d1ea99604f4f4e814beadc0286dc6 to your computer and use it in GitHub Desktop.
カラーコードの自動生成
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
/* generateRandomColorcode.js */ | |
function generateRandomColorcode() { | |
var str = ""; | |
for (var i = 0; i < 6; i++) { | |
str = str + Math.round(Math.random()*15).toString(16); | |
} | |
return "#" + str | |
} | |
console.log(generateRandomColorcode()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment