Closed SeanPM5 closed 1 month ago
Thanks.
Do you know if these are universally available for all the sports the APIs support? The API only returns the regular logos. I could obviously derive them if I knew they were available for all sports. Also, do you know how to programmatically determine if dark mode is selected?
Quick testing indicates that dark logos are not universally available and dark mode is indicated by hass.themes.darkMode. I'll see what I can do w/o breaking current functionality when I get a chance.
Thanks for looking into it. I'm not sure how widespread the dark variant images are, but from a quick test it appears to be supported on all the "Big Four" leagues (NFL, MLB, NBA, NHL). Some additional examples here:
NFL (NY Jets): Light: https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/nyj.png Dark: https://a.espncdn.com/i/teamlogos/nfl/500-dark/scoreboard/nyj.png
NFL (NY Giants): Light: https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/nyg.png Dark: https://a.espncdn.com/i/teamlogos/nfl/500-dark/scoreboard/nyg.png
NBA (Utah Jazz): Light: https://a.espncdn.com/i/teamlogos/nba/500/scoreboard/utah.png Dark: https://a.espncdn.com/i/teamlogos/nba/500-dark/scoreboard/utah.png
NHL (Maple Leafs): Light: https://a.espncdn.com/i/teamlogos/nhl/500/scoreboard/tor.png Dark: https://a.espncdn.com/i/teamlogos/nhl/500-dark/scoreboard/tor.png
I haven't yet seen a 404 error on those "dark" URL's for these particular sports. It seems that if there's no dark-specific logo it simply returns the "light" logo rather than any kind of error. So I think it's safe for NFL, MLB, NBA, NHL but I can't say 100% for certain.
I know the card supports a lot more sports than those four leagues though.
Just tried it for european soccer teams (Juventus) and the 500-dark also works.
The only problem I see here is, that there is no specific dark entry in the team attributes.
Anyways it would be awesome if it can be done ;)
I definitely like the idea. Looks like rugby, cricket, and Australian rules football are some sports that could cause problems. I'm not getting a page not found error but am also not getting a dark logo. I'll have to make the change and see how they behave, how I can detect, etc.
Thanks for the idea
Added in release v0.14.7. Thanks for the idea. It should automatically detect when the theme is in dark mode and use the dark mode logos.
Thanks! It works great and makes a big difference on my tablet.
One minor thing, the team/opponent backgrounds aren't using the dark variant logos. Doesn't bother me personally as I plan to use card-mod to hide those, but just wanted to point it out.
How it looks now (the Yankees side looks like it doesn't have a background at all, but it's just illegible):
How it would look with dark team logo backgrounds:
I noticed but wanted time to confirm the league logos have dark mode versions too (they do) before adding.
Added background dark mode logos to v0.14.9
The default team logos for some teams look pretty bad in dark mode, here is the Yankees for example:
There are dark mode variants of these logos available, it would be nice if they were used instead when the user is in dark mode. It makes a big improvement for readability:
Another before/after example:
Here are example of URL's (same structure and filename but
/500/
becomes/500-dark/
):Regular URL's that Team Tracker card currnently uses: https://a.espncdn.com/i/teamlogos/mlb/500/scoreboard/nyy.png Dark mode URL's: https://a.espncdn.com/i/teamlogos/mlb/500-dark/scoreboard/nyy.png