
カラーコードのランダム生成に注意すること
DRANK
JavaScriptでカラーコードをランダムに生成して表示するコードを書いたら、なんかやたらと白い。 let r = Math.floor(Math.random() * 255).toString(16); let g = Math.floor(Math.random() * 255).toString(16); let b = Math.floor(Math.random() * 255).toString(16); let color = '#' + r + g...