js乘以小数的时候,零可以省略
比如width*0.5
和
width*.5
是一样的
取最小值,保证是正值
x = Math.max( Math.min( a,b ), 0 );a,b可正可负,
随机颜色
(Math.random() * 0x404040 + 0xaaaaaa | 0).toString(16)
本文共 208 字,大约阅读时间需要 1 分钟。
比如width*0.5
和
width*.5
是一样的
a,b可正可负,
(Math.random() * 0x404040 + 0xaaaaaa | 0).toString(16)
转载于:https://my.oschina.net/lirongfei/blog/165156