summaryrefslogtreecommitdiff
path: root/src/client/scripts/theme.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-10-16 19:55:44 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-10-16 19:55:44 +0900
commit8a1f3a4c0b5732d0f08f0788d93c5934de8960c8 (patch)
treebe6fbcf3a1bbd78306d91e19ef6f3e7023f41561 /src/client/scripts/theme.ts
parentMerge branch 'develop' (diff)
parent12.92.0 (diff)
downloadmisskey-8a1f3a4c0b5732d0f08f0788d93c5934de8960c8.tar.gz
misskey-8a1f3a4c0b5732d0f08f0788d93c5934de8960c8.tar.bz2
misskey-8a1f3a4c0b5732d0f08f0788d93c5934de8960c8.zip
Merge branch 'develop'
Diffstat (limited to 'src/client/scripts/theme.ts')
-rw-r--r--src/client/scripts/theme.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts
index 3fb5666a72..e79d54fa6d 100644
--- a/src/client/scripts/theme.ts
+++ b/src/client/scripts/theme.ts
@@ -1,3 +1,4 @@
+import { globalEvents } from '@client/events';
import * as tinycolor from 'tinycolor2';
export type Theme = {
@@ -24,6 +25,7 @@ export const builtinThemes = [
require('@client/themes/d-persimmon.json5'),
require('@client/themes/d-astro.json5'),
require('@client/themes/d-future.json5'),
+ require('@client/themes/d-botanical.json5'),
require('@client/themes/d-black.json5'),
] as Theme[];
@@ -62,6 +64,9 @@ export function applyTheme(theme: Theme, persist = true) {
if (persist) {
localStorage.setItem('theme', JSON.stringify(props));
}
+
+ // 色計算など再度行えるようにクライアント全体に通知
+ globalEvents.emit('themeChanged');
}
function compile(theme: Theme): Record<string, string> {
@@ -87,6 +92,8 @@ function compile(theme: Theme): Record<string, string> {
case 'darken': return color.darken(arg);
case 'lighten': return color.lighten(arg);
case 'alpha': return color.setAlpha(arg);
+ case 'hue': return color.spin(arg);
+ case 'saturate': return color.saturate(arg);
}
}