hex код
This commit is contained in:
12
get_data.py
12
get_data.py
@@ -560,18 +560,18 @@ async def game():
|
||||
@app.get("/status.json")
|
||||
async def status(request: Request):
|
||||
def color_for_status(status_value: str) -> str:
|
||||
"""Подбор текстового цвета для статуса"""
|
||||
"""Подбор цвета статуса в HEX"""
|
||||
status_value = str(status_value).lower()
|
||||
if status_value in ["ok", "success", "live", "live_soon", "online"]:
|
||||
return "green"
|
||||
return "#00FF00" # зелёный
|
||||
elif status_value in ["scheduled", "today_not_started", "upcoming"]:
|
||||
return "yellow"
|
||||
return "#FFFF00" # жёлтый
|
||||
elif status_value in ["result", "resultconfirmed", "finished", "finished_today"]:
|
||||
return "red"
|
||||
return "#FF0000" # красный
|
||||
elif status_value in ["no_game_today", "unknown", "none"]:
|
||||
return "white"
|
||||
return "#FFFFFF" # белый
|
||||
else:
|
||||
return "gray"
|
||||
return "#808080" # серый (неизвестный статус)
|
||||
|
||||
data = {
|
||||
"league": LEAGUE,
|
||||
|
||||
Reference in New Issue
Block a user