GNOME dependable installation, structure and style improvements

Split utils in utils.py to a directory
Moved ./gnome-shell_css/ to ./gnome-shell/.css/
This commit is contained in:
Vladyslav Hroshev
2024-09-30 00:14:09 +03:00
parent 48975c9b07
commit 8cce85a437
40 changed files with 413 additions and 306 deletions

View File

@@ -0,0 +1,22 @@
def hex_to_rgba(hex_color):
"""
Convert hex(a) to rgba
:param hex_color: input value
"""
try:
if len(hex_color) in range(6, 10):
hex_color = hex_color.lstrip('#') + "ff"
# if is convertable
int(hex_color[:], 16)
else:
raise ValueError
except ValueError:
raise ValueError(f'Error: Invalid HEX color code: {hex_color}')
else:
return int(hex_color[0:2], 16), \
int(hex_color[2:4], 16), \
int(hex_color[4:6], 16), \
int(hex_color[6:8], 16) / 255