图书馆小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
288 B

2 weeks ago
  1. /**
  2. * 返回随机色值
  3. */
  4. export let getRandomColor = () => {
  5. const rgb = [];
  6. for (let i = 0; i < 3; ++i) {
  7. let color = Math.floor(Math.random() * 256).toString(16);
  8. color = color.length == 1 ? '0' + color : color;
  9. rgb.push(color);
  10. }
  11. return '#' + rgb.join('');
  12. };