code: function randColor (colorType) {
    if (colorType === 'rgba') {
      let a = []
      for (let i = 0; i < 3; i++) {
        a.push(tools.rnd(0, 255))
      }
      a.push(Math.round(Math.random() * 10) / 10)
      return `rgba(${a[0]},${a[1]},${a[2]},${a[3]})`
    } else {
      return `#${randData('0123456789abcdef', 6)}`
    }
  }
docs: 随机生成颜色,参数二选一[null or rgba]