Ignore invalid title bar color

This commit is contained in:
pagedown 2021-12-21 17:51:00 +08:00
parent 10e0077a6f
commit 8abfb50aed
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -686,7 +686,11 @@ def titlebar_color(x: str) -> int:
return 0
if x == 'background':
return 1
return (color_as_int(to_color(x)) << 8) | 2
try:
return (color_as_int(to_color(x)) << 8) | 2
except ValueError:
log_error(f'Ignoring invalid title bar color: {x}')
return 0
def macos_titlebar_color(x: str) -> int: