テーマインポート機能を実装するなど

This commit is contained in:
syuilo 2020-03-23 19:06:46 +09:00
parent b12bf78c6d
commit dac962580b
10 changed files with 118 additions and 12 deletions

View file

@ -102,3 +102,10 @@ function compile(theme: Theme): { [key: string]: string } {
function genValue(c: tinycolor.Instance): string {
return c.toRgbString();
}
export function validateTheme(theme: Record<string, any>): boolean {
if (theme.id == null) return false;
if (theme.name == null) return false;
if (theme.base == null || !['light', 'dark'].includes(theme.base)) return false;
return true;
}