Download src/lib/scoring.ts from abhirsc/True_Kart: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/abhirsc/True_Kart/resolve/main/src/lib/scoring.ts
- Command line
-
hf download hf://spaces/abhirsc/True_Kart/src/lib/scoring.ts
-
curl -L -o scoring.ts https://huggingface.co/spaces/abhirsc/True_Kart/resolve/main/src/lib/scoring.ts
457 Bytes
| export function scoreColor(score: number): string { | |
| if (score > 70) return "var(--score-high)"; | |
| if (score >= 40) return "var(--score-mid)"; | |
| return "var(--score-low)"; | |
| } | |
| export function nutriBadgeClass(letter: "A" | "B" | "C" | "D" | "E"): string { | |
| const map: Record<string, string> = { | |
| A: "bg-emerald-600", | |
| B: "bg-lime-600", | |
| C: "bg-amber-600", | |
| D: "bg-orange-600", | |
| E: "bg-red-600", | |
| }; | |
| return map[letter] ?? "bg-slate-600"; | |
| } | |