From e87f5b07cd98dfc65f05ed78c049cbcf8a14b5e7 Mon Sep 17 00:00:00 2001 From: "helix.song" Date: Tue, 23 Apr 2024 18:29:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=20@ctrl/tinycolor=20=E4=BE=9D=E8=B5=96=E5=BA=93,?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=B8=8D=E5=85=BC=E5=AE=B94.1.x=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/package.json | 1 + ui/src/theme/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/package.json b/ui/package.json index 0ac8d5a23..c9c61d73c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -13,6 +13,7 @@ "format": "prettier --write src/" }, "dependencies": { + "@ctrl/tinycolor": "^4.1.0", "axios": "^0.28.0", "cropperjs": "^1.6.2", "echarts": "^5.5.0", diff --git a/ui/src/theme/index.ts b/ui/src/theme/index.ts index 047e63862..451558c92 100644 --- a/ui/src/theme/index.ts +++ b/ui/src/theme/index.ts @@ -5,7 +5,7 @@ import type { UpdateInferData, UpdateKeyValueData } from './type' -import tinycolor from '@ctrl/tinycolor' +import { TinyColor } from '@ctrl/tinycolor' // 引入默认推断数据 import inferData from './defaultInferData' // 引入默认keyValue数据 @@ -119,7 +119,7 @@ class Theme { l.toString() ) return { - [varName]: tinycolor(inferData.value) + [varName]: new TinyColor(inferData.value) .mix(key === 'light' ? this.colorWhite : this.colorBlack, l * 10) .toHexString() }