Function: teamColorPalette()
teamColorPalette(
league,teams,o?):string[]
Defined in: packages/sdvplot/src/svelte-core.ts:266
One colour per team, in order: a LayerChart series' color, a <Spline stroke>, or the chart's cRange. With
background, every colour keeps 3:1 contrast against it (dark mode) and aims to stay distinct from the others (when
it cannot, it keeps the readable colour and warns once).
Parameters
league
"aaf" | "ahl" | "ajhl" | "bchl" | "cchl" | "cebl" | "cfb" | "cfl" | "chl" | "cricket" | "easl" | "echl" | "f1" | "fiba" | "gojhl" | "iihf" | "kijhl" | "lba" | "mbb" | "mhl" | "milb" | "mjhl" | "mlb" | "nba" | "nbagl" | "nbl" | "ncaa_baseball" | "ncaa_mhockey" | "ncaa_softball" | "ncaa_whockey" | "nfl" | "nhl" | "nojhl" | "ohl" | "ojhl" | "phf" | "pwhl" | "qmjhl" | "sjhl" | "soccer" | "sphl" | "ufl" | "usfl" | "ushl" | "vijhl" | "wbb" | "whl" | "wnba" | "xfl"
teams
readonly unknown[]
o?
Returns
string[]
Example
import { loadLeague } from "@sportsdataverse/sdvplot";
import { teamColorPalette } from "@sportsdataverse/sdvplot/svelte";
await loadLeague("nfl");
teamColorPalette("nfl", ["KC", "LAC", "DEN", "LV"], { background: "#181a1b" });