Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: UX Colorize aspect ratios, landscape vs portrait #2926

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,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)
Expand Down