From 0a98c5dab4f2783ff5250cb69715340b40d801bb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 05 四月 2023 18:23:08 +0800 Subject: [PATCH] 2023-04-05 --- src/mob/colorsketch/index.jsx | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mob/colorsketch/index.jsx b/src/mob/colorsketch/index.jsx index 58c6d9b..65c7df6 100644 --- a/src/mob/colorsketch/index.jsx +++ b/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 -- Gitblit v1.8.0