From 95e73b141ca8f3618701ff59658ef519353cc7c0 Mon Sep 17 00:00:00 2001 From: Chandler J Date: Fri, 12 Apr 2024 20:44:47 -0600 Subject: major changes: - Can now save/load themes which entails the color scheme and wallpaper - Can now use themes to load colors independent of background image - refactoring to make code less bad --- src/user_interface.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/user_interface.py') diff --git a/src/user_interface.py b/src/user_interface.py index 934098c..f55c588 100644 --- a/src/user_interface.py +++ b/src/user_interface.py @@ -1,17 +1,20 @@ import os import random import color_engine +import manage_saves from rich import print def colorPickerUI(img_path: str, num_palettes: int) -> tuple: -#display the selected color scheme and ask user if they like it or want to generate a new color scheme + """ + display the selected color scheme and ask user if they like it + or want to generate a new color scheme + """ hex_colors, hex_compliments = selectPalette(img_path, num_palettes) final_colors, final_compliments = selectColorsFromPalette(hex_colors, hex_compliments) return final_colors, final_compliments def selectPalette(img_path: str, num_palettes: int) -> tuple: - # confirmed = False while not confirmed: print() @@ -86,3 +89,15 @@ def pickRandomWallpaper(walls_dir) -> str: confirmed = True return wallpaper + +def saveThemePrompt(hex_colors, hex_compliments, wallpaper_location, theme_location): + print('[bold green]Save configuration as preset? (y/n)') + do_save = input('>') + if do_save == 'y': + print('[bold green]enter theme name') + theme_name = input('>') + theme_path = theme_location + theme_name + ".theme" + + manage_saves.save_theme(hex_colors, hex_compliments, wallpaper_location, theme_path) + print(f'[bold green]Theme {theme_name} saved!') + -- cgit v1.2.3