Function: palette()
palette(
league,teams?,opts?):Promise<Record<string,string>>
Defined in: packages/sdvplot/src/colors.ts:34
{team: "#hex"} for a league. Without teams: keyed by abbr, or team_id where abbr is null/shared (one warning).
With teams: keyed by the caller's own values; first team wins on a reused value.
Parameters
league
"aaf" | "ahl" | "cfb" | "cricket" | "echl" | "mbb" | "milb" | "mlb" | "nba" | "nbagl" | "ncaa_baseball" | "ncaa_mhockey" | "ncaa_softball" | "ncaa_whockey" | "nfl" | "nhl" | "ohl" | "phf" | "pwhl" | "qmjhl" | "soccer" | "ufl" | "usfl" | "ushl" | "wbb" | "whl" | "wnba" | "xfl"
teams?
opts?
ColorOptions = {}
Returns
Promise<Record<string, string>>
Example
import { palette } from "@sportsdataverse/sdvplot";
await palette("nfl", ["KC", "BUF", "PHI"]);