| nba.colors | R Documentation |
Returns a named character vector of hex colors for an NBA team. Teams cover
the 2026-27 NBA season, plus the Seattle SuperSonics.
Call colorr.teams("nba") for the full list of team names.
nba.colors(
set = c("blazers", "bucks", "bulls", "cavs", "celtics", "clippers", "grizzlies",
"hawks", "heat", "hornets", "jazz", "kings", "knicks", "lakers", "magic", "mavs",
"nets", "nuggets", "pacers", "pelicans", "pistons", "raptors", "rockets", "sixers",
"sonics", "spurs", "suns", "thunder", "warriors", "wizards", "wolves"),
legacy = FALSE
)
set |
Character string naming an NBA team. |
legacy |
Logical. If |
Named character vector of hex color strings.
Charles Crabtree charles.crabtree@monash.edu
colorr.teams to list teams, scale_fill_nba for the
ggplot2 scales.
# Detroit Pistons colors
pal <- nba.colors("pistons")
pal
pie(rep(1, length(pal)), labels = sprintf("%d (%s)", seq_along(pal), pal), col = pal)
# Milwaukee Bucks colors
nba.colors("bucks")
# the palette that shipped with colorr 1.0.1
nba.colors("pistons", legacy = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.