Skip to contents

A tibble including the color map of 51 gradient palettes. Some palettes also include a definition of color 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 gray colors
aspectcolrGeneralAspect-oriented rainbow colors0 to 360
bcyrGeneralBlue through cyan and yellow to red
bgyrGeneralBlue through green and yellow to red
bluesGeneralWhite to blue
bygGeneralBlue through yellow to green
byrGeneralBlue through yellow to red
celsiusGeneralBlue to red for Celsius temperatures-80 to 80
corineLand coverEU Corine land cover colors111 to 995
curvatureGeneralTerrain curvature colors-0.1 to 0.1
differencesGeneralDifference-oriented colors
elevationTopographyRelative raster values mapped to elevation colors
etopo2TopographyETOPO2 worldwide bathymetry and topography colors-11000 to 8850
eviNaturalEnhanced Vegetation Index colors-1 to 1
fahrenheitTemperatureBlue to red for Fahrenheit temperatures-112 to 176
forest_coverNaturalPercentage of forest cover0 to 1
gddNaturalAccumulated growing degree days0 to 6000
grassGeneralPerceptually uniform GRASS GIS green
greensGeneralWhite to green
greyGeneralGrayscale
gyrGeneralGreen through yellow to red
haxbyTopographyRelative colors for bathymetry or topography
infernoGeneralInferno perceptually uniform sequential color table
kelvinTemperatureBlue to red for temperatures in Kelvin193.15 to 353.15
magmaGeneralMagma perceptually uniform sequential color table
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
plasmaGeneralPlasma perceptually uniform sequential color table
populationHumanHuman population classification breaks0 to 1000000
population_densHumanHuman population density classification breaks0 to 1000
precipitationClimatePrecipitation color table, 0 to 2000 mm0 to 7000
precipitation_dailyClimateDaily precipitation color table, 0 to 1000 mm0 to 100
precipitation_monthlyClimateMonthly precipitation color table, 0 to 1000 mm0 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 to white
slopeGeneralr.slope.aspect-style slope colors for raster values from 0 to 900 to 90
soilmoistureNaturalSoil moisture color table, 0.0 to 1.00 to 1
srtmTopographyShuttle Radar Topography Mission elevation colors-11000 to 8850
srtm_plusTopographyShuttle Radar Topography Mission elevation colors with seafloor colors-11000 to 8850
terrainTopographyGlobal elevation color table from -11000 to +8850 m-11000 to 8850
viridisGeneralViridis perceptually uniform sequential color table
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"
  )

# }