//创建一个x~y之间的随机数(不包含y值),Math.round(Math.random() * (y - x)) + x;  

//0-5之间的随机数,不包含5
var index: Number = Math.round(Math.random() * 5);
var colors: Array = ["#FF00FF", "#0000FF", "#000000", "#008000", "#800000"];
color
= colors[index];

//15-25之间的随机数,不包含25
var index: Number = Math.round(Math.random() * (25 - 15)) + 15;

随机16进制颜色:Alert.show((Math.random()
* 0xffffff).toString(16));
color
= "#" + (Math.random()* 0xffffff).toString(16);

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2021-12-30
  • 2021-12-04
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-23
  • 2021-07-25
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
相关资源
相似解决方案