Skip to main content

Primary and secondary colours

{
  "KC": {
    "primary": "#e31837",
    "secondary": "#ffb612"
  },
  "LAC": {
    "primary": "#007bc7",
    "secondary": "#ffc20e"
  },
  "DEN": {
    "primary": "#002244",
    "secondary": "#fb4f14"
  },
  "LV": {
    "primary": "#000000",
    "secondary": "#a5acaf"
  },
  "BUF": {
    "primary": "#00338d",
    "secondary": "#c60c30"
  },
  "MIA": {
    "primary": "#008e97",
    "secondary": "#f58220"
  },
  "NYJ": {
    "primary": "#003f2d",
    "secondary": "#000000"
  },
  "NE": {
    "primary": "#002244",
    "secondary": "#c60c30"
  }
}
import { STANDINGS } from "@sportsdataverse/examples/data";
import { teamColors, teamColorsSync } from "@sportsdataverse/sdvplot";

const teams = STANDINGS.map((s) => s.team);
const primary = await teamColors("nfl", teams); // loads the league, then one colour per value
const secondary = teamColorsSync("nfl", teams, { which: "secondary" }); // the league is loaded now

Object.fromEntries(teams.map((t, i) => [t, { primary: primary[i], secondary: secondary[i] }]));

Tags: teamColors · colors · nfl. All sdvplot examples.