forked from shiosyakeyakini-info/miria
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request shiosyakeyakini-info#204 from poppingmoon/theme-json5
Misskeyのテーマを読み込めるように
- Loading branch information
Showing
9 changed files
with
1,664 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:json5/json5.dart'; | ||
import 'package:miria/model/color_theme.dart'; | ||
import 'package:miria/model/misskey_theme.dart'; | ||
|
||
void main() { | ||
final themes = [ | ||
"l-light", | ||
"d-dark", | ||
"l-coffee", | ||
"d-persimmon", | ||
"l-apricot", | ||
"d-astro", | ||
"l-rainy", | ||
"d-future", | ||
"l-botanical", | ||
"d-botanical", | ||
"l-vivid", | ||
"d-green-lime", | ||
"l-cherry", | ||
"d-green-orange", | ||
"l-sushi", | ||
"d-cherry", | ||
"l-u0", | ||
"d-ice", | ||
"d-u0", | ||
] | ||
.map( | ||
(name) => ColorTheme.misskey( | ||
MisskeyTheme.fromJson( | ||
JSON5.parse( | ||
File( | ||
"assets_builder/misskey/packages/frontend/src/themes/$name.json5", | ||
).readAsStringSync(), | ||
), | ||
), | ||
), | ||
) | ||
.map( | ||
(theme) => 'ColorTheme(' | ||
'id: "${theme.id}", ' | ||
'name: "${theme.name}", ' | ||
'isDarkTheme: ${theme.isDarkTheme}, ' | ||
'primary: ${theme.primary}, ' | ||
'primaryDarken: ${theme.primaryDarken}, ' | ||
'primaryLighten: ${theme.primaryLighten}, ' | ||
'background: ${theme.background}, ' | ||
'foreground: ${theme.foreground}, ' | ||
'renote: ${theme.renote}, ' | ||
'mention: ${theme.mention}, ' | ||
'hashtag: ${theme.hashtag}, ' | ||
'link: ${theme.link}, ' | ||
'divider: ${theme.divider}, ' | ||
'buttonBackground: ${theme.buttonBackground}, ' | ||
'panel: ${theme.panel}, ' | ||
'panelBackground: ${theme.panelBackground}, ' | ||
')', | ||
) | ||
.toList(); | ||
// ignore: avoid_print | ||
print(themes); | ||
runApp(MaterialApp(home: Scaffold(body: SelectableText(themes.toString())))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.