Browse Source

加入随机颜色

胡家华 5 years ago
parent
commit
3492518acf
1 changed files with 7 additions and 0 deletions
  1. 7 0
      index.js

+ 7 - 0
index.js

210
     timeLeft.sec = diff;
210
     timeLeft.sec = diff;
211
     return timeLeft;
211
     return timeLeft;
212
   }
212
   }
213
+const RandomColor = function randomColor(){
214
+  var r = Math.floor(Math.random()*256);
215
+  var g = Math.floor(Math.random()*256);
216
+  var b = Math.floor(Math.random()*256);
217
+  return "rgb("+r+","+g+","+b+")";
218
+};
213
 
219
 
214
 export default {
220
 export default {
215
     ScanSensitiveWords, // 查找敏感词 敏感词汇屏蔽为 ****
221
     ScanSensitiveWords, // 查找敏感词 敏感词汇屏蔽为 ****
224
     Base64, // 转为Base64的字符串v
230
     Base64, // 转为Base64的字符串v
225
     MathRand, // 获取随机数
231
     MathRand, // 获取随机数
226
     getDiffTime, // 计算时差
232
     getDiffTime, // 计算时差
233
+    RandomColor, // 随机颜色
227
 }
234
 }