Skip to content

Commit b947110

Browse files
committed
feat: add wallpaper and config to json file
refs: #147
1 parent a8a9ec4 commit b947110

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/kde_material_you_colors/apply_themes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def apply(config: Configs, wallpaper: WallpaperReader, dark_light):
4040
)
4141

4242
# Export generated schemes to output file
43-
m3_scheme_utils.export_schemes(schemes)
43+
m3_scheme_utils.export_schemes(schemes, config, wallpaper, dark_light)
4444

4545
# Make plasma color schemes
4646
plasma_utils.make_scheme(schemes)

src/kde_material_you_colors/utils/m3_scheme_utils.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from materialyoucolor.dislike.dislike_analyzer import DislikeAnalyzer
1515
from materialyoucolor.blend import Blend
1616
from materialyoucolor.dynamiccolor.dynamic_color import DynamicColor
17+
from kde_material_you_colors.config import Configs
1718
from kde_material_you_colors.utils.color_utils import rgb2hex
1819
from kde_material_you_colors.utils.color_utils import argbFromHex
1920
from kde_material_you_colors.utils.color_utils import hexFromArgb
@@ -284,7 +285,12 @@ def get_color_schemes(
284285
return materialYouColors
285286

286287

287-
def export_schemes(theme: ThemeConfig):
288+
def export_schemes(
289+
theme: ThemeConfig,
290+
config: Configs,
291+
wallpaper: WallpaperReader,
292+
dark_light: None | bool,
293+
):
288294
"""Export generated schemes to MATERIAL_YOU_COLORS_JSON
289295
290296
Args:
@@ -297,6 +303,12 @@ def export_schemes(theme: ThemeConfig):
297303
"light": theme.get_wal_light_scheme(),
298304
"dark": theme.get_wal_dark_scheme(),
299305
},
306+
"wallpaper": {
307+
"type": wallpaper.type,
308+
"data": wallpaper.source,
309+
},
310+
"light": dark_light,
311+
"config": config.options,
300312
}
301313
)
302314

0 commit comments

Comments
 (0)