From 013cc64702ceb98c8484096dff3ba28a38ef642e Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 9 Jun 2023 13:47:25 +0800 Subject: [PATCH] improve svg and background --- src/components/charts/apexChartConfig.ts | 7 ++++-- src/libs/utils.ts | 4 ++-- src/pages/index.vue | 28 +++++++++++++++++++++++- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/components/charts/apexChartConfig.ts b/src/components/charts/apexChartConfig.ts index 42c91f63..70f55bc1 100644 --- a/src/components/charts/apexChartConfig.ts +++ b/src/components/charts/apexChartConfig.ts @@ -1,5 +1,8 @@ +import { useBlockchain } from '@/stores'; import numeral from 'numeral'; +const chainStore = useBlockchain() + const themeColors = (theme: string) => { if (theme === 'light') { return { @@ -9,7 +12,7 @@ const themeColors = (theme: string) => { surface: '#FFFFFF', 'surface-variant': '#424242', 'on-surface-variant': '#EEEEEE', - primary: '#666CFF', + primary: chainStore.current?.themeColor || '#666CFF', 'primary-darken-1': '#3700B3', secondary: '#6D788D', 'secondary-darken-1': '#018786', @@ -89,7 +92,7 @@ const themeColors = (theme: string) => { surface: '#30334E', 'surface-variant': '#BDBDBD', 'on-surface-variant': '#424242', - primary: '#666CFF', + primary: chainStore.current?.themeColor || '#666CFF', 'primary-darken-1': '#3700B3', secondary: '#6D788D', 'secondary-darken-1': '#03DAC5', diff --git a/src/libs/utils.ts b/src/libs/utils.ts index 93dc185d..b374fe44 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -132,8 +132,8 @@ export function rgbToHsl(color: string) { // console.log(r,g,b, '88') const max = Math.max(r, g, b); const min = Math.min(r, g, b); - let h, - s, + let h = 0, + s = 0, l = (max + min) / 2; if (max == min) { diff --git a/src/pages/index.vue b/src/pages/index.vue index e13597ca..e368a1ad 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -7,6 +7,7 @@ import { } from '@/stores/useDashboard'; import ChainSummary from '@/components/ChainSummary.vue'; import { computed, ref } from 'vue'; +import { useBlockchain } from '@/stores'; const dashboard = useDashboard(); @@ -23,12 +24,31 @@ const chains = computed(() => { return Object.values(dashboard.chains); } }); +const chainStore = useBlockchain() + +