colorr.pal: Team color palette generator

View source: R/scales.R

colorr.palR Documentation

Team color palette generator

Description

Turns a team palette into a palette function of the kind ggplot2 and grDevices expect: call it with n and it returns n colors. When n exceeds the number of colors the team actually has, the palette is interpolated with colorRampPalette.

Usage

colorr.pal(league, set, reverse = FALSE, legacy = FALSE)

Arguments

league

Character string naming a league, as returned by colorr.leagues, or "soccer" for every soccer club at once.

set

Character string naming a team in that league.

reverse

Logical. If TRUE, reverse the color order.

legacy

Logical. If TRUE, build from the colorr 1.0.1 palette.

Value

A function of one argument n returning a character vector of n hex colors.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

See Also

scale_fill_nba and friends, which wrap this for ggplot2.

Examples

pal <- colorr.pal("nba", "bucks")
pal(3)
pal(8)  # interpolated past the team's own colors

colorr documentation built on Aug. 22, 2026, 5:08 p.m.