[GRASS5] [bug #3049] (grass) ps.map

Hamish hamish_nospam at yahoo.com
Tue Mar 1 17:49:00 EST 2005


> this bug's URL: http://intevation.de/rt/webrt?serial_num=3049
> ---------------------------------------------------------------------
..
> GRASS Version: grass-6.0.cvs_src_snapshot_2005_02_12
> 
> ps.map input=ps2.txt output=map1.ps
> ERROR: color purple : illegal color request
> 
> although ps.map.html says it is supported:
> 
> NAMED COLORS
> The following are the colors that are accepted by ps.map:
> 
> <snip>
> purple
> red
> violet
> white
> yellow


purple is not a standard GRASS color given by D_color_list(), but is
defined in ps/ps.map/ps_colors.c:

static struct {
    char *name;
    float r, g, b;
} colors[NUM_COLORS] =
{
    {"white",   1.00, 1.00, 1.00},
    {"black",   0.00, 0.00, 0.00},
    {"red",     1.00, 0.00, 0.00},
    {"green",   0.00, 1.00, 0.00},
    {"blue",    0.00, 0.00, 1.00},
    {"yellow",  1.00, 1.00, 0.00},
    {"magenta", 1.00, 0.00, 1.00},
    {"cyan",    0.00, 1.00, 1.00},
    {"aqua",     0.00, 0.75, 0.75},
    {"grey",    0.75, 0.75, 0.75},
    {"gray",    0.75, 0.75, 0.75},
    {"orange",  1.00, 0.50, 0.00},
    {"brown",   0.75, 0.50, 0.25},
    {"purple",  0.50, 0.00, 1.00},
    {"violet",  0.50, 0.00, 1.00},
    {"indigo",   0.00, 0.50, 1.00}
};


my guess is that for some ps.map functions "purple" works, for others it
doesn't.

For consistency & simplicity, we should probably just use standard grass
colors here? Better yet use grass lib functions for colors.

PostScript needs R:G:B as 0.0-1.0 not 0-255, so some scaling is needed.


Hamish




More information about the grass-dev mailing list