summaryrefslogtreecommitdiff
path: root/src/user_interface.py
diff options
context:
space:
mode:
authorChandler J <cjustice2000@gmail.com>2023-12-11 20:38:07 -0700
committerGitHub <noreply@github.com>2023-12-11 20:38:07 -0700
commitc11972edf3e08112d94083f0d3ccb7abec77df19 (patch)
tree9fa7aef82b2fe2ad0f457acc7c821f14c1eef7d1 /src/user_interface.py
parentf029061dad768be5e7c39c1f6152660a0bbaf050 (diff)
parentc8f2a2635ec90499bd2ec75969f222f398c1bbc5 (diff)
Merge pull request #1 from chandlerj/refactor
Refactor
Diffstat (limited to 'src/user_interface.py')
-rw-r--r--src/user_interface.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/user_interface.py b/src/user_interface.py
new file mode 100644
index 0000000..32abf60
--- /dev/null
+++ b/src/user_interface.py
@@ -0,0 +1,51 @@
+import os
+import random
+from paths import Paths
+import color_engine
+from rich import print
+
+
+def colorPickerUI(img_path: str):
+#display the selected color scheme and ask user if they like it or want to generate a new color scheme
+ confirmed = False
+ while not confirmed:
+ print()
+ popularColors = color_engine.grabColors(img_path, 3)
+ hex_colors = color_engine.rgbToHex(popularColors)
+ hex_compliments = color_engine.compColors(hex_colors)
+
+ main_colors = ''
+ complimentary_colors = ''
+
+ for color in hex_colors:
+ main_colors += f'[on {color}] [/on {color}]'
+ print(main_colors)
+ for color in hex_compliments:
+ complimentary_colors += f'[on {color}] [/on {color}]'
+ print(complimentary_colors)
+ print()
+ count = 0
+ for i in range(len(hex_colors)):
+ print(f'[{hex_compliments[i]} on {hex_colors[i]}]\tGenerated Color Scheme\t\t ({count})')
+ count += 1
+ print('[bold](a)ccept (r)etry')
+ response = input('> ')
+ if response == 'r':
+ continue
+ else:
+ confirmed = True
+ return hex_colors, hex_compliments
+
+def pickRandomWallpaper():
+ confirmed = False
+ while not confirmed:
+ wallpaper = Paths['wallpapers'] + random.choice(os.listdir(Paths['wallpapers']))
+ os.system(f'viu {wallpaper}')
+ print(f'picked wallpaper: {wallpaper}')
+ print('[bold](a)ccept (r)etry')
+ response = input('>')
+
+ if response == 'a':
+ confirmed = True
+
+ return wallpaper