Skip to contents

A five-color green-to-red ramp with its luminance range lifted so it still reads on a near-black background. The default palette in gt_color_ranks() is built for white paper, and its mid-tones collapse into a dark ground. Pass this instead when using gt_theme_midnight() or gt_theme_terminal().

Usage

pal_midnight

Format

A character vector of five hex colors, running best to worst.

Examples

west <- subset(
  sdv_example_standings, league == "nba" & conference == "Western",
  c(team_name, wins, losses, win_pct)
)
gt::gt(west) |>
  gt_theme_midnight() |>
  gt_color_ranks(win_pct, palette = pal_midnight)
team_name wins losses win_pct
Oklahoma City Thunder 64 18 0.780
Denver Nuggets 54 28 0.659
Minnesota Timberwolves 49 33 0.598
Portland Trail Blazers 42 40 0.512
Utah Jazz 22 60 0.268
Los Angeles Lakers 53 29 0.646
Phoenix Suns 45 37 0.549
LA Clippers 42 40 0.512
Golden State Warriors 37 45 0.451
Sacramento Kings 22 60 0.268
San Antonio Spurs 62 20 0.756
Houston Rockets 52 30 0.634
New Orleans Pelicans 26 56 0.317
Dallas Mavericks 26 56 0.317
Memphis Grizzlies 25 57 0.305