Spaces:
Sleeping
Sleeping
Download utils.py from patrickramos/draft-day-cards: direct link, hf CLI and curl.
- Browser
- Download file 861 Bytes
-
https://huggingface.co/spaces/patrickramos/draft-day-cards/resolve/main/utils.py
- Command line
-
hf download hf://spaces/patrickramos/draft-day-cards/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/patrickramos/draft-day-cards/resolve/main/utils.py
861 Bytes
| from pyfonts import load_google_font | |
| team_to_color = { | |
| "Yomiuri Giants": "#f69727", | |
| "Yakult Swallows": "#abcd05", | |
| "DeNA BayStars": "#004a8f", | |
| "Chunichi Dragons": "#08b1e8", | |
| "Hanshin Tigers": "#ffe100", | |
| "Hiroshima Carp": "#f92b20", | |
| "Nippon-Ham Fighters": "#016299", | |
| "Rakuten Eagles": "#7d001a", | |
| "Seibu Lions": "#00214b", | |
| "Chiba Lotte Marines": "#efefef", | |
| "Orix Buffaloes": "#baa834", | |
| "SoftBank Hawks": "#fcc700", | |
| } | |
| def get_text_color_from_team(team): | |
| if team in [ | |
| "DeNA BayStars", | |
| "Nippon-Ham Fighters", | |
| "Seibu Lions", | |
| "Rakuten Eagles", | |
| ]: | |
| return "white" | |
| else: | |
| return "black" | |
| font = load_google_font("Saira Extra Condensed", weight="medium") | |
| bold_font = load_google_font("Saira Extra Condensed", weight="bold") | |
| alt_font = load_google_font("Ubuntu") | |