diff options
Diffstat (limited to 'src/client/scripts/theme.ts')
| -rw-r--r-- | src/client/scripts/theme.ts | 7 |
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); } } |