[GRASS5] D_color

Hamish hamish_nospam at yahoo.com
Mon May 16 20:20:34 EDT 2005


> according to d.vect.thematic, I try to modify d.legend slightly, so it
> is useable for vector maps too.
..
> d.legend uses
> 
>     int D_color(int color)
> 
> but how to set the (int color) value for it from R:G:B colors?

Not looking at the code but as a general comment, d.legend has the
color= option which does not handle R:G:B input. It does use R:G:B 
values to match the raster value's color. Keep in mind there are
multiple "color tables" in play, on the display driver level as well as
the map level.

see here for how to change the color for drawing, either by R:G:B or by
name:

http://freegis.org/cgi-bin/viewcvs.cgi/grass6/display/d.mapgraph/do_graph.c.diff?r1=2.0&r2=2.1


> I don't know, if I can make d.legend work with vector files, but I try
> it :-)

the structure for d.legend is *cough* rather intricate, and not broken
down into functions easily. Most of the structure exists somewhere in
the back of my head though. Please put the vector code in a function, a)
so I can quickly review it, and b) so the mess doesn't get worse (I want
to continue to understand how the module works).



Hamish




More information about the grass-dev mailing list