about summary refs log tree commit diff
path: root/src/alf/util
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-05-31 14:45:41 -0500
committerGitHub <noreply@github.com>2024-05-31 20:45:41 +0100
commit5cda807d9dcdbc5ed5dbb51a9c43123d60734c8a (patch)
treee080ec65e68779ef2027d5debf04971bec3ec439 /src/alf/util
parentf868821cfcc87b62a320e5a1e11375fdb973adc1 (diff)
downloadvoidsky-5cda807d9dcdbc5ed5dbb51a9c43123d60734c8a.tar.zst
Tweak avi follow button styles (#4304)
* Tighten up

* Tweak colors

* Tweak for night mode

* Add missing file

* Contrast plus
Diffstat (limited to 'src/alf/util')
-rw-r--r--src/alf/util/themeSelector.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/alf/util/themeSelector.ts b/src/alf/util/themeSelector.ts
new file mode 100644
index 000000000..f484bc526
--- /dev/null
+++ b/src/alf/util/themeSelector.ts
@@ -0,0 +1,14 @@
+import {ThemeName} from '#/alf/themes'
+
+export function select<T>(name: ThemeName, options: Record<ThemeName, T>) {
+  switch (name) {
+    case 'light':
+      return options.light
+    case 'dark':
+      return options.dark || options.dim
+    case 'dim':
+      return options.dim || options.dark
+    default:
+      throw new Error(`select(theme, options) received unknown theme ${name}`)
+  }
+}