[GRASS-dev] [bug #5243] (grass) d.vect: better random color generation

Martin Landa landa.martin at gmail.com
Fri Nov 17 10:45:47 EST 2006


Hi,

I have tried to implement random coloring using
G_make_random_colours(), see the attached patch for d.vect.

If there are no serious objections, I will committ the changes into
CVS. Then I will also try to implement random colors based on the
given attribute column.

Best regards, Martin

2006/10/29, Request Tracker <grass-bugs at intevation.de>:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=5243
> -------------------------------------------------------------------------
>
> [wish]
>
> Hi,
>
> currently "d.vect -c" random colors is limited to 16 colors, which do
> not rotate between calls. (you get the same colors every time, d.redraw
> doesn't help if you don't like the results)
>
> see display/d.vect/plot.h for current candidates.
>
> I suggest using random color code from lib/gis/color_rand.c to do a
> better job. It seems to work pretty well.
>
>
> or if that won't work (too many cats to store RGB values) start with
> random seed and calculate R,G,B values by some mathematical function
> which will give the same answers for those 3 variables within the module
> run.
>
>
> thanks,
> Hamish
>
>
> --- Headers Follow ---
>
> >From hamish_nospam at yahoo.com  Sun Oct 29 08:12:05 2006
> Return-Path: <hamish_nospam at yahoo.com>
> Delivered-To: grass-bugs at lists.intevation.de
> Received: from kolab.intevation.de (aktaia [212.95.126.10])
>         by lists.intevation.de (Postfix) with ESMTP id D9B871006AB
>         for <grass-bugs at lists.intevation.de>; Sun, 29 Oct 2006 08:12:05 +0100 (CET)
> Received: from localhost (localhost.localdomain [127.0.0.1])
>         by kolab.intevation.de (Postfix) with ESMTP id BFDC41B1A17
>         for <grass-bugs at lists.intevation.de>; Sun, 29 Oct 2006 08:12:05 +0100 (CET)
> Received: from localhost (localhost.localdomain [127.0.0.1])
>         by kolab.intevation.de (Postfix) with ESMTP id A690B1AFCC3
>         for <grass-bugs at lists.intevation.de>; Sun, 29 Oct 2006 08:12:05 +0100 (CET)
> Received: from mailhub1.otago.ac.nz (mailhub1.otago.ac.nz [139.80.64.218])
>         by kolab.intevation.de (Postfix) with ESMTP id B66381AD41A
>         for <grass-bugs at intevation.de>; Sun, 29 Oct 2006 08:10:31 +0100 (CET)
> Received: from galadriel.otago.ac.nz (galadriel.otago.ac.nz [139.80.64.213])
>         by mailhub1.otago.ac.nz (8.13.6/8.13.6) with ESMTP id k9T7AQP8003694
>         for <grass-bugs at intevation.de>; Sun, 29 Oct 2006 20:10:26 +1300
> Received: from taihua.otago.ac.nz ([139.80.35.27] helo=taihua)
>         by galadriel.otago.ac.nz with smtp (Exim 4.50)
>         id 1Ge4oH-0003m1-R6
>         for grass-bugs at intevation.de; Sun, 29 Oct 2006 20:10:21 +1300
> Date: Sun, 29 Oct 2006 20:10:26 +1300
> From: Hamish <hamish_nospam at yahoo.com>
> To: grass-bugs at intevation.de
> Subject: d.vect: better random color generation
> Message-Id: <20061029201026.72a37491.hamish_nospam at yahoo.com>
> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
> X-Face: M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB
>  8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G, at rg6/QMJ
> Mime-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
> X-Virus-Scanned: by amavisd-new at intevation.de
> X-Spam-Status: No, hits=1.7 tagged_above=-999 required=3 tests=[BAYES_20=-1,
>  FORGED_YAHOO_RCVD=2.7]
> X-Spam-Level: *
>
> -------------------------------------------- Managed by Request Tracker
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d_vect-rcols.diff.gz
Type: application/x-gzip
Size: 6137 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20061117/3a69628d/d_vect-rcols.diff.gz


More information about the grass-dev mailing list