[GRASS5] Re: [GRASSLIST:3252] r.colors color= proposal
Hamish
hamish_nospam at yahoo.com
Sun Apr 25 08:26:28 EDT 2004
> > > Actually, maybe we should just change the semantics of the
> > > "color=..." option so that anything other than "rules", "grey.eq",
> > > "grey.log" and"random" is treated as the name of a rules file.
> >
> > This is a great idea.
>
> For now, rather than changing the behaviour of color=, I've added a
> rules= option and rule files for the existing options (minus those
> cases noted above).
Folks should note that files loaded with the rules= option must be
located in the $GISBASE/etc/colors/ directory.
> I considered adding the (dynamically generated) list of rule files to
> opt4->options. However, given that adding new rule files is trivial, I
> suspect that the list could easily grow to the point where the option
> would need to be removed to avoid making a mess of "r.colors help".
see 'g.mapsets -l'
> Regarding grey.eq and grey.log: it's arguable that histogram
> equalisation (linear and logarithmic) could be applied to any colour
> scheme, not just grey-scale. In which case, maybe they should be a
> separate option rather than a specific colour scheme.
Interesting.. figuring out a log-color map by hand is a pain and doing
something simple like 'r.mapcalc logmap=log(map)' is wasteful.
I've also found being able to flip a colormap is often useful & doubles
your possibilities without very much overhead. I guess that only works
with all-percentage based rules however. All the predefined ones are
percentage based though, with the exception of byg, byr, gyr, and ryg
which all contain "0 white". Perhaps those 0 rules should be removed now
that GRASS has NULL support?
In other r.colors news, I've just added support for colon separated
R:G:B triplets, to be consistent with the d.* modules[*]. Backwards
compatibility with space separated triplets is maintained, although
should be left unadvertised IMO.
e.g.
> 1 0:120:255
seems less confusing than
> 1 0 120 255
to me.
[*] I'm pretty much finished with TrueColor support for core modules
now; let me know if there are any others you want done.
I commented out the code for non-referenced color-only rules, as a) they
don't work, and b) I can't figure out what they are supposed to be doing
in the first place.
e.g.
> blue
> green
> 200:40:120
73s,
Hamish
More information about the grass-dev
mailing list