NAME

r.colors - Crea o modifica la tabla de color asociada a un mapa raster.
(GRASS Raster Program)
 

USO

r.colors
r.colors help
r.colors [-wq] map=nombre [color=paleta] [rast=nombre]
 

OPCIONES

La opción -w hace que la nueva tabla de colores se cree solamente si el mapa no tenía una paleta de colores previamente creada.

La opción -q hace que el comando se ejecute en modo silencioso

Map es el mapa al que se va a crear una nueva tabla de colores. Color es la paleta de colores en la que se va a basar la nueva tabla. Rast es un fichero del que se va a copiar la tabla de color. La paleta debe ser alguna de las siguientes:

color type      description 
aspect          (aspect oriented grey colors) 
grey            (grey scale) 
grey.eq         (histogram-equalized grey scale) 
gyr             (green through yellow to red colors) 
rainbow         (rainbow color table) 
ramp            (color ramp) 
random          (random color table) 
ryg             (red through yellow to green colors) 
wave            (color wave) 
rules           (create new color table based on 
                user-specified rules)

Color table types aspect, grey, grey.eq (histogram-equalized grey scale), gyr (green-yellow-red), rainbow, ramp, ryg (red-yellow-green), random, and wave are pre-defined color tables that r.colors knows how to create without any further input.

The rules color table type will cause r.colors to read color table specifications from standard input (stdin) and will build the color table accordingly.

Using color table type rules, there are three ways to build a color table: by color list, by category values, and by "percent" values.

Building a customized color table by color list is the simplest of the three rules methods: just list the colors you wish to appear in the color table in the order that you wish them to appear. Use the standard GRASS color names: white, black, red, green, blue, yellow, magenta, cyan, aqua, grey, gray, orange, brown, purple, violet, and indigo.

For example, to create a color table for the raster map layer elevation that assigns greens to low map category values, browns to the next larger map category values, and yellows to the still larger map category values, one would type:

r.colors map=elevation color=rules
green
brown
yellow
end

To build a color table by category values' indices, the user should determine the range of category values in the raster map layer with which the color table will be used. Specific category values will then be associated with specific colors. Note that a color does not have to be assigned for every valid category value because r.colors will interpolate a color ramp to fill in where color specification rules have been left out. The format of such a specification is as follows:

category_value color_name
category_value color_name
.. ..
.. ..
category_value color_name
end

Each category value must be valid for the raster map layer, category values must be in ascending order and only use standard GRASS color names (see above).

Colors can also be specified by color numbers each in the range 0-255. The format of a category value color table specification using color numbers instead of color names is as follows:

category_value red_number green_number blue_number
category_value red_number green_number blue_number
.. .. .. ..
.. .. .. ..
category_value red_number green_number blue_number
end

Specifying a color table by "percent" values allows one to treat a color table as if it were numbered from 0 to 100. The format of a "percent" value color table specification is the same as for a category value color specification, except that the category values are replaced by "percent" values, each from 0-100, in ascending order. The format is as follows:

percent_value% color_name
percent_value% color_name
.. ..
.. ..
percent_value% color_name
end

Using "percent" value color table specification rules, colors can also be specified by color numbers each in the range 0-255. The format of a percent value color table specification using color numbers instead of color names is as follows:

percent_value% red_number green_number blue_number
percent_value% red_number green_number blue_number
.. .. .. ..
.. .. .. ..
percent_value% red_number green_number blue_number
end

Note that you can also mix these three methods of color table specification; for example:

0 black
10% yellow
78 blue
magenta
purple
brown
100% 0 255 230
end

EJEMPLOS

  1. The below example shows how you can specify colors for a three category map, assigning red to category 1, green to category 2, and blue to category 3. Start by using a text editor, like vi, to create the following rules specification file. Save it with the name rules.file.

  2.  

     
     
     

    1 red
    2 green
    3 blue
    end

    The color table can then by assigned to map threecats by typing the following command at the GRASS> prompt:

    cat rules.file | r.colors map=threecats color=rules
  3. To create a natural looking LUT for true map layer elevation, use the following rules specification file. It will assign light green shades to the lower elevations (first 20% of the LUT), and then darker greens (next 15%, and next 20%) and light browns (next 20%) for middle elevations, and darker browns (next 15%) for higher elevations, and finally yellow for the highest peaks (last 10% of LUT).
  4. 0% 0 230 0

    20% 0 160 0
    35% 50 130 0
    55% 120 100 30
    75% 120 130 40
    90% 170 160 50
    100% 255 255 100

VER

d.colormode
d.colors
d.colortable
d.display
d.legend
p.colors
r.support

AUTORES

Michael Shapiro and David Johnson