首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >随机颜色

随机颜色

作者头像
ProsperLee
发布于 2018-10-24 10:43:17
发布于 2018-10-24 10:43:17
1.5K0
举报
代码语言:javascript
复制
1     function rancolor() {
2         var r = Math.floor(Math.random() * 256);
3         var g = Math.floor(Math.random() * 256);
4         var b = Math.floor(Math.random() * 256);
5         var a = Math.random();
6         return "rgb(" + r + ',' + g + ',' + b + ")";
7     }
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018-07-15 ,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档