[O] Clear screen with title
This commit is contained in:
parent
f86792356e
commit
299adb8e4d
2 changed files with 7 additions and 4 deletions
|
@ -49,12 +49,15 @@ def printc(msg: str):
|
||||||
print(color(msg + '&r'))
|
print(color(msg + '&r'))
|
||||||
|
|
||||||
|
|
||||||
def clear_screen():
|
def clear_screen(title: str = ''):
|
||||||
"""
|
"""
|
||||||
Clear screen using ANSI escape codes
|
Clear screen using ANSI escape codes
|
||||||
"""
|
"""
|
||||||
print('\033[2J\033[H', end='')
|
print('\033[2J\033[H', end='')
|
||||||
|
|
||||||
|
if title:
|
||||||
|
printc(title)
|
||||||
|
|
||||||
|
|
||||||
def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
|
def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -103,8 +103,8 @@ def create_config() -> Config:
|
||||||
|
|
||||||
:return: Config object (automatically stored)
|
:return: Config object (automatically stored)
|
||||||
"""
|
"""
|
||||||
clear_screen()
|
title = '\nWelcome to &b&lhy&f&lfetch&r! Let\'s set up some colors first.\n'
|
||||||
printc('\nWelcome to &b&lhy&f&lfetch&r! Let\'s set up some colors first.\n')
|
clear_screen(title)
|
||||||
|
|
||||||
# Select color system
|
# Select color system
|
||||||
try:
|
try:
|
||||||
|
@ -129,7 +129,7 @@ def create_config() -> Config:
|
||||||
color_system = literal_input('Which &acolor &bsystem &rdo you want to use?',
|
color_system = literal_input('Which &acolor &bsystem &rdo you want to use?',
|
||||||
['8bit', 'rgb'], 'rgb')
|
['8bit', 'rgb'], 'rgb')
|
||||||
|
|
||||||
clear_screen()
|
clear_screen(title)
|
||||||
|
|
||||||
# Print preset
|
# Print preset
|
||||||
print('Available presets:\n')
|
print('Available presets:\n')
|
||||||
|
|
Loading…
Reference in a new issue