MyNixOS website logo
Description

An NBA Jersey Palette Generator.

Palettes generated from NBA jersey colorways.

Travis buildstatus

NBA Palettes

This package is based on the amazing wesanderson package. It includes color palettes taken from a large variety of NBA jersey colorways. These can be used to Spicy P up your plots. The package currently contains 129 different palettes.

Installation

devtools::install_github('murrayjw/nbapalettes')

Usage

library("nbapalettes")

# See available palettes
available_palettes()
#> # A tibble: 129 x 3
#>    teams   palette_names     palette_colors                                     
#>    <chr>   <chr>             <chr>                                              
#>  1 bobcats bobcats           #0C2340, #418FDE, #1B365D, #E35205, #888B8D        
#>  2 bobcats bobcats_original  #F9423A, #1B365D, #8D9093, #010101                 
#>  3 blazers blazers           #E13A3E, #C4CED4, #000000                          
#>  4 blazers blazers_statement #C8102E, #010101, #373A36                          
#>  5 blazers blazers_city      #fea30c, #203b7e, #0881c6, #cf152d, #df4826        
#>  6 blazers blazers_city2     #2E2E2E, #140C0B, #C72830, #EC3036                 
#>  7 bucks   bucks             #00471B, #EEE1C6, #0077C0, #000000                 
#>  8 bucks   bucks_earned      #7AC043, #00713D, #014711, #CB0423, #D7D7D7, #FFFF~
#>  9 bucks   bucks_00s         #AC1A2F, #274E37, #95999D                          
#> 10 bucks   bucks_retro       #2C5234, #00843D, #6CC24A, #DE7C00, #010101        
#> # ... with 119 more rows

Palettes

The package currently contains 129 palettes based on various NBA jerseys from every current NBA team and a few of former teams (Bobcats, Supersonics, New Orleans Hornets).

Denver Nuggets

The structure of the palette names is: teamname_jerseytype. For example to see the Utah Jazz city colors for this season:

nba_palette("nuggets_city2")

Utah Jazz

nba_palette("jazz_city")

Toronto Raptors

nba_palette("raptors_original")

nba_palette("raptors_military")

Miami Heat

The package comes with team results from the 2020 NBA season (obtained using nbastatR::game_logs() from the nbastatR package).

library("ggplot2")
library("dplyr")
data(nba_results2020)

nba_results2020 %>% 
   filter(nameTeam == 'Miami Heat') %>% 
   ggplot(aes(ptsTeam, fill = factor(isWin))) + 
   geom_density()+
   scale_fill_manual(values = nba_palette("heat"))

nba_palette() takes an argument type which can be either continuous or discrete.


pal <- nba_palette("heat_vice", 100, type = "continuous")

nba_results2020 %>% 
  ggplot(aes(pctFG2Team, pctFG3Team)) +
  geom_point(aes(colour = ptsTeam)) +
  scale_colour_gradientn(colours = pal) +
  theme_minimal()

More examples

nba_palette("bucks_earned")

nba_palette("bucks_city2")

nba_palette("bobcats")

nba_palette("grizzlies_retro")

nba_palette("grizzlies_retro", 'continuous', n = 100)

nba_palette("sixers_city")

nba_palette("warriors")

nba_palette("warriors_00s")

Combining Palettes

Palettes can be combined by passing a vector of palette names

nba_palette(c("warriors", "warriors_00s"))

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows