This commit is contained in:
Chris Huang-Leaver 2025-09-11 20:44:50 +05:30 committed by GitHub
commit 9946085fb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -768,7 +768,12 @@ def add_ratio(x):
a, b = x.replace('*', ' ').split(' ')[:2]
a, b = int(a), int(b)
g = math.gcd(a, b)
return f'{a}×{b} <span style="color: grey;"> \U00002223 {a // g}:{b // g}</span>'
portrait_color = "cyan"
landscape_color = "green"
square_color = "red"
color = landscape_color if a > b else portrait_color
color = square_color if a == b else color
return f'{a}×{b} <span style="color: grey;">\U00002223 </span> <span style="color: {color};"> {a // g}:{b // g}</span>'
default_aspect_ratio = add_ratio(default_aspect_ratio)