| | |
| | | } |
| | | |
| | | normal_colors.forEach(item => { |
| | | if (!colors.includes(item)) { |
| | | colors.push(item) |
| | | } |
| | | colors.push({color: item, title: '常用色:' + item}) |
| | | }) |
| | | } else { |
| | | normal_colors = [] |
| | | } |
| | | |
| | | if (_colors) { |
| | |
| | | } |
| | | |
| | | _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}) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | normal_colors.unshift(color) |
| | | normal_colors = Array.from(new Set(normal_colors)) |
| | | |
| | | if (normal_colors.length > 10) { |
| | | normal_colors.length = 10 |