Skip to main content

Function: teamColors()

teamColors<T>(league, teams, opts?): Promise<ColorResult<T>>

Defined in: packages/sdvplot/src/colors.ts:131

Team colour(s), loading the league first: one team gives one #hex (or undefined), an array gives one per team. which: "secondary" picks the second colour; an unknown team gives undefined and one warning.

Type Parameters​

T​

T extends Value | readonly 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​

T

opts?​

ColorOptions = {}

Returns​

Promise<ColorResult<T>>

Example​

import { teamColors } from "@sportsdataverse/sdvplot";

await teamColors("nba", ["LAL", "BOS"], { which: "secondary" });