Color tables live in $GISBASE/etc/colors (see SVN)
- r.colors (r.colors manual in GRASS 7 has colors tables embedded as well as the GUI dialog)
- r.colors.stddev (samples)
- r3.colors (GRASS 7 only)
- r3.colors.out (GRASS 7 only)
- v.colors.out (GRASS 7 only)
- User contributed color rules in the GRASS Addons repository
- Convert from GMT color tables with r.cpt2grass
- Use r.colors.quantiles to create raster colors rules based on n-quantiles. It uses the R and the spgrass6 package.
- Use r.colors.out_sld to export GRASS raster colors rules in OGC SLD template v1.0.0 XML format for Geoserver and the ilk
- Use r.colors.out_vtk to export GRASS raster colors rules for use with VTK-based visualization software.
- There is an online colormap repository with many fine GMT (and many others) gradients at
- There are a number of command line tools for working with the GMT .cpt files at
The numeric values of following color tables can be found in the here
These user contributions can be found in the GRASS addons SVN repository
- The script used to create these thumbnails can be found on the discussion page.
Using GRASS color palettes in QGIS
Most of them can already be found there, you just have to hunt for them. In the raster layer properties window's style tab, select "Singleband pseudocolor" as the type, "Generate new color map", "New color ramp", for ramp type choose "cpt-city", change to the "Sort by Author" tab, and look for "grass". They can also be found in the QGIS section cpt-city's QGIS theme.
If there's a new set of color rules which are not in QGIS, you can prepare a .svg palette file for use with QGIS using the following commands. Consider to then open a ticket in the QGIS issue tracker asking them to add it (and attach the file of course to save someone some work :)
You will need the cptsvg command line tool from cptutils and the GRASS 6 addon module r.out.gmt.
g.region n=100 s=0 w=0 e=100 res=1 r.mapcalc "dummy = row()" r.colors dummy color=roygbiv r.out.gmt dummy out=roygbiv rm roygbiv.grd cptsvg --geometry=300x45 -o roygbiv.svg -v roygbiv.cpt r.colors dummy rules=~/grass/svn/grass-addons/grass6/raster/r.colors.tools/palettes/palette_sst.gcolors r.out.gmt dummy out=palette_sst rm palette_sst.grd cptsvg --geometry=300x45 -o palette_sst.svg -v palette_sst.cpt
You can then copy the resulting .svg file into /usr/share/qgis/resources/cpt-city-qgis-min/grass/ on Linux (or C:\Program Files\QGIS VERSION\apps\qgis\resources\cpt-city-qgis-min\grass\ on MS Windows).
Loading QGIS color palettes into GRASS
Currently the GRASS 6 addon module r.cpt2grass seems to hit a bug, but the general idea is to use the svgx command line program from the cptutils package, using GMT's .cpt color table format as a go-between:
svgx --output dkbluered.cpt --type cpt /usr/share/qgis/resources/cpt-city-qgis-min/h5/dkbluered.svg r.cpt2grass in=dkbluered.cpt output=dkbluered.gcolors