From 816493e01ffe613ba4eca1d56a71a8cbf1099bf6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 11 Oct 2021 00:36:47 +0900 Subject: :art: --- src/client/scripts/theme.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/client/scripts/theme.ts') diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts index 3fb5666a72..10842b8943 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 = { @@ -62,6 +63,9 @@ export function applyTheme(theme: Theme, persist = true) { if (persist) { localStorage.setItem('theme', JSON.stringify(props)); } + + // 色計算など再度行えるようにクライアント全体に通知 + globalEvents.emit('themeChanged'); } function compile(theme: Theme): Record { -- cgit v1.2.3-freya From 23de45cea5b84b26c352836a12d33c46210dc0fc Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 14 Oct 2021 01:25:19 +0900 Subject: feat(client): add new theme --- src/client/scripts/theme.ts | 1 + src/client/themes/d-botanical.json5 | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/client/themes/d-botanical.json5 (limited to 'src/client/scripts/theme.ts') diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts index 10842b8943..9f165f7998 100644 --- a/src/client/scripts/theme.ts +++ b/src/client/scripts/theme.ts @@ -25,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[]; diff --git a/src/client/themes/d-botanical.json5 b/src/client/themes/d-botanical.json5 new file mode 100644 index 0000000000..f3665e22b2 --- /dev/null +++ b/src/client/themes/d-botanical.json5 @@ -0,0 +1,26 @@ +{ + id: '504debaf-4912-6a4c-5059-1db08a76b737', + + name: 'Mi Botanical Dark', + author: 'syuilo', + + base: 'dark', + + props: { + accent: 'rgb(148, 179, 0)', + bg: 'rgb(37, 38, 36)', + fg: 'rgb(216, 212, 199)', + fgHighlighted: '#fff', + divider: 'rgba(255, 255, 255, 0.14)', + panel: 'rgb(47, 47, 44)', + panelHeaderBg: '@panel', + panelHeaderDivider: '@divider', + header: ':alpha<0.7<@panel', + navBg: '#363636', + renote: '@accent', + mention: 'rgb(212, 153, 76)', + mentionMe: 'rgb(212, 210, 76)', + hashtag: 'rgb(76, 212, 180)', + link: '@accent', + }, +} -- cgit v1.2.3-freya From 3f95bd53cd7a3eedf2c47f53544b268d4c010d69 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 14 Oct 2021 01:25:50 +0900 Subject: feat(client): add some theme functions --- src/client/scripts/theme.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/client/scripts/theme.ts') diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts index 9f165f7998..e79d54fa6d 100644 --- a/src/client/scripts/theme.ts +++ b/src/client/scripts/theme.ts @@ -92,6 +92,8 @@ function compile(theme: Theme): Record { 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); } } -- cgit v1.2.3-freya