king
2023-04-05 0a98c5dab4f2783ff5250cb69715340b40d801bb
src/mob/colorsketch/index.jsx
@@ -50,10 +50,10 @@
      }
      
      normal_colors.forEach(item => {
        if (!colors.includes(item)) {
          colors.push(item)
        }
        colors.push({color: item, title: '常用色:' + item})
      })
    } else {
      normal_colors = []
    }
    if (_colors) {
@@ -64,15 +64,15 @@
      }
      
      _colors.forEach(item => {
        if (!colors.includes(item.linkurl)) {
          colors.push(item.linkurl)
        }
        if (normal_colors.includes(item.linkurl)) return
        colors.push({color: item.linkurl, title: '系统色:' + item.linkurl})
      })
    }
    if (colors.length < 40) {
      for (let i = colors.length; i < 40; i++) {
        colors.push('transparent')
        colors.push({color: 'transparent', title: '' + i})
      }
    }
@@ -102,8 +102,8 @@
  onVisibleChange = (status) => {
    const { initVal, color } = this.state
    if (!status && color && color !== initVal) {
    if (!status && color && color !== initVal && color !== 'rgba(0, 0, 0, 0)' && color !== 'transparent' && !/rgba\(\d+,\s*\d+,\s*\d+,\s*0\)/.test(color)) {
      let normal_colors = localStorage.getItem(_href + 'normal_colors')
      if (normal_colors) {
@@ -117,6 +117,7 @@
      }
      normal_colors.unshift(color)
      normal_colors = Array.from(new Set(normal_colors))
      if (normal_colors.length > 10) {
        normal_colors.length = 10