@@ -21,14 +21,15 @@ import NavigationMobile from '@/components/NavigationMobile.vue'
2121import { useSnackbarStore } from ' @/composables/snackbar'
2222import { useSessionStore } from ' @/stores/session'
2323import { ThemeType , useSettingsStore } from ' @/stores/settings'
24+ import { accentColors } from ' @/utils/colors'
2425import { updateAllData } from ' @/utils/update'
2526
2627const router = useRouter ()
2728const { mobile } = useDisplay ()
2829const theme = useTheme ()
2930
3031const { currentEntityList } = storeToRefs (useSessionStore ())
31- const { themeType, enablePullToRefresh } = storeToRefs (useSettingsStore ())
32+ const { themeType, accentColor, enablePullToRefresh } = storeToRefs (useSettingsStore ())
3233
3334const routerTitle = computed (() => router .currentRoute .value .meta .title )
3435
@@ -74,6 +75,23 @@ watch(
7475 { immediate: true },
7576)
7677
78+ watch (
79+ accentColor ,
80+ accentColor => {
81+ const color = accentColors .find (color => color .name === accentColor )!
82+
83+ theme .themes .value .light .colors .primary = color .primary
84+ theme .themes .value .light .colors .secondary = color .secondaryLight
85+ theme .themes .value .light .variables [' current-time-color' ] = color .currentTime
86+
87+ theme .themes .value .dark .colors .primary = color .primary
88+ theme .themes .value .dark .colors .secondary = color .secondaryDark
89+
90+ document .querySelector (' meta[name="theme-color"]' )?.setAttribute (' content' , color .theme )
91+ },
92+ { immediate: true },
93+ )
94+
7795const pages: { title: string ; link: string ; icon: string }[] = [
7896 { title: ' Viri' , link: ' sources' , icon: mdiFileDocumentOutline },
7997 { title: ' Naročanje' , link: ' subscribe' , icon: mdiRss },
0 commit comments