[+] osc: parse background color

This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-10-22 18:22:51 -04:00
parent cb5635908f
commit 4e11d21401
No known key found for this signature in database
GPG key ID: E289FAC0DA92DD2B
2 changed files with 25 additions and 9 deletions

View file

@ -100,9 +100,7 @@ class RGB(NamedTuple):
:param hex: Hex color code
:return: RGB object
"""
while hex.startswith('#'):
hex = hex[1:]
hex = hex.lstrip("#")
r = int(hex[0:2], 16)
g = int(hex[2:4], 16)
b = int(hex[4:6], 16)