Skip to contents

A tibble including the color map of 51 gradient palettes. Some palettes includes also a definition of colors limits that can be used with ggplot2::scale_fill_gradientn().

Format

A tibble of 2920 rows and 6 columns. with the following fields:

pal

Name of the palette.

limit

(Optional) limit for each color.

r

Value of the red channel (RGB color mode).

g

Value of the green channel (RGB color mode).

b

Value of the blue channel (RGB color mode).

hex

Hex code of the color.

Details

Summary of palettes provided, description and recommended use:

paletteusedescriptionrange
aspectGeneralaspect oriented grey colors
aspectcolrGeneralaspect oriented rainbow colors0 to 360
bcyrGeneralblue through cyan through yellow to red
bgyrGeneralblue through green through yellow to red
bluesGeneralwhite to blue
bygGeneralblue through yellow to green
byrGeneralblue through yellow to red
celsiusGeneralblue to red for degree Celsius temperature-80 to 80
corineLand CoverEU Corine land cover colors111 to 995
curvatureGeneralfor terrain curvatures-0.1 to 0.1
differencesGeneraldifferences oriented colors
elevationTopographymaps relative ranges of raster values to elevation color ramp
etopo2Topographycolors for ETOPO2 worldwide bathymetry/topography-11000 to 8850
eviNaturalenhanced vegetative index colors-1 to 1
fahrenheitTemperatureblue to red for Fahrenheit temperature-112 to 176
forest_coverNaturalpercentage of forest cover0 to 1
gddNaturalaccumulated growing degree days0 to 6000
grassGeneralGRASS GIS green (perceptually uniform)
greensGeneralwhite to green
greyGeneralgrey scale
gyrGeneralgreen through yellow to red
haxbyTopographyrelative colors for bathymetry or topography
infernoGeneralperceptually uniform sequential color table inferno
kelvinTemperatureblue to red for temperature in Kelvin scale193.15 to 353.15
magmaGeneralperceptually uniform sequential color table magma
ndviNaturalNormalized Difference Vegetation Index colors-1 to 1
ndwiNaturalNormalized Difference Water Index colors-200 to 200
nlcdLand CoverUS National Land Cover Dataset colors0 to 95
orangesGeneralwhite to orange
plasmaGeneralperceptually uniform sequential color table plasma
populationHumancolor table covering human population classification breaks0 to 1000000
population_densHumancolor table covering human population density classification breaks0 to 1000
precipitationClimateprecipitation color table (0..2000mm)0 to 7000
precipitation_dailyClimateprecipitation color table (0..1000mm)0 to 100
precipitation_monthlyClimateprecipitation color table (0..1000mm)0 to 1000
rainbowGeneralrainbow color table
rampGeneralcolor ramp
redsGeneralwhite to red
roygbivGeneral
rstcurvGeneralterrain curvature (from r.resamp.rst)-0.1 to 0.1
rybGeneralred through yellow to blue
rygGeneralred through yellow to green
sepiaGeneralyellowish-brown through to white
slopeGeneralr.slope.aspect-type slope colors for raster values 0-900 to 90
soilmoistureNaturalsoil moisture color table (0.0-1.0)0 to 1
srtmTopographycolor palette for Shuttle Radar Topography Mission elevation-11000 to 8850
srtm_plusTopographycolor palette for Shuttle Radar Topography Mission elevation (with seafloor colors)-11000 to 8850
terrainTopographyglobal elevation color table covering -11000 to +8850m-11000 to 8850
viridisGeneralperceptually uniform sequential color table viridis
waterNaturalwater depth
waveGeneralcolor wave

terra equivalent

terra::map.pal()

References

GRASS Development Team (2024). Geographic Resources Analysis Support System (GRASS) Software, Version 8.3.2. Open Source Geospatial Foundation, USA. https://grass.osgeo.org.

Examples

# \donttest{
data("grass_db")

grass_db
#> # A tibble: 2,920 × 6
#>    pal        limit     r     g     b hex    
#>    <chr>      <dbl> <dbl> <dbl> <dbl> <chr>  
#>  1 aspect        NA     0     0     0 #000000
#>  2 aspect        NA   255   255   255 #FFFFFF
#>  3 aspect        NA     0     0     0 #000000
#>  4 aspectcolr     0   255   255   255 #FFFFFF
#>  5 aspectcolr     1   255   255     0 #FFFF00
#>  6 aspectcolr    90     0   255     0 #00FF00
#>  7 aspectcolr   180     0   255   255 #00FFFF
#>  8 aspectcolr   270   255     0     0 #FF0000
#>  9 aspectcolr   360   255   255     0 #FFFF00
#> 10 bcyr          NA     0     0   255 #0000FF
#> # ℹ 2,910 more rows
# Select a palette

srtm_plus <- grass_db %>%
  filter(pal == "srtm_plus")

f <- system.file("extdata/asia.tif", package = "tidyterra")
r <- terra::rast(f)

library(ggplot2)

p <- ggplot() +
  geom_spatraster(data = r) +
  labs(fill = "elevation")

p +
  scale_fill_gradientn(colors = srtm_plus$hex)


# Use with limits
p +
  scale_fill_gradientn(
    colors = srtm_plus$hex,
    values = scales::rescale(srtm_plus$limit),
    limit = range(srtm_plus$limit),
    na.value = "lightblue"
  )

# }