11<script setup lang="ts">
22import type { GlobalThemeOverrides } from ' naive-ui'
33import { darkTheme , NConfigProvider , NLoadingBarProvider , NMessageProvider } from ' naive-ui'
4+ import Tiny from ' tinycolor2'
45import { computed , onMounted } from ' vue'
56import { useI18n } from ' vue-i18n'
67
@@ -13,15 +14,20 @@ const store = useStore()
1314
1415const theme = computed (() => (store .darkMode ? darkTheme : null ))
1516const override = computed (
16- () =>
17- ({
17+ () => {
18+ const themeColor = store .darkMode ? ' #a879db' : ' #6f106e'
19+ return ({
1820 common: {
19- primaryColor: store .darkMode ? ' #ffffff' : ' #6f106e' ,
20- primaryColorHover: store .darkMode ? ' #fcfcfc' : ' #6f106e' ,
21- primaryColorPressed: store .darkMode ? ' d4d4d4' : ' #560c56' ,
22- primaryColorSuppl: ' #6f106e' ,
21+ primaryColor: Tiny (themeColor ).toHex8String (),
22+ primaryColorSecondary: Tiny (themeColor ).setAlpha (0.16 ).toHex8String (),
23+ primaryColorHover: Tiny (themeColor ).lighten (7.5 ).brighten (1 ).desaturate (20 ).spin (- 2 ).toHex8String (),
24+ primaryColorPressed: Tiny (themeColor ).darken (10 ).saturate (8 ).spin (2 ).toHex8String (),
25+ primaryColorSuppl: Tiny (themeColor ).lighten (7.5 ).brighten (1 ).desaturate (20 ).spin (- 2 ).toHex8String (),
26+ borderRadius: ' 5px' ,
2327 },
24- } as GlobalThemeOverrides ),
28+ } as GlobalThemeOverrides )
29+ },
30+
2531)
2632
2733onMounted (
0 commit comments