summaryrefslogtreecommitdiff
path: root/src/user_interface.py
diff options
context:
space:
mode:
authorChandler J <cjustice2000@gmail.com>2024-04-12 20:44:47 -0600
committerChandler J <cjustice2000@gmail.com>2024-04-12 20:44:47 -0600
commit95e73b141ca8f3618701ff59658ef519353cc7c0 (patch)
tree27967d34376bc6ed624c12c758f580a712765118 /src/user_interface.py
parentb7dc1316ab0eb51f408b2b7782571d868ad3b864 (diff)
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
Diffstat (limited to 'src/user_interface.py')
-rw-r--r--src/user_interface.py19
1 files changed, 17 insertions, 2 deletions
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!')
+