LoginSignup
4
3

More than 5 years have passed since last update.

JSでランダムにRGBを取得する。

Last updated at Posted at 2014-03-03

var color = '#' + ("00000"+Math.floor(Math.random() * 0x1000000).toString(16)).substr(-6);

綺麗な色だけを取りたいときは固定値の配列の方がいい。

4
3
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3