[GRASS-dev] Background Colours

Michael Barton michael.barton at asu.edu
Thu May 17 11:25:42 EDT 2007


A general observation for parsing GRASS command strings into a GUI interface
using the xml generated by --interface-description.

It would be easier to parse colors if...
1) transparency could be an independent flag that overrides color selection
rather than be a color selection of "none". FWIW, it would be good if all
options that permitted a color to be set also permitted this feature to be
set to transparent too.
2) if all features which accept the small list of GRASS standard color
strings also accept color in rrr:ggg:bbb format (maybe this is already the
case?

Currently, many features (but not all) accept "none" as a color option, and
features that do accept "none" do not indicate it in a standard way for the
interface xml output. Requiring a single argument to accept either a color
string OR a transparency indicator is simple to deal with when typing (and
where the interface hints are irrelevant), but makes it much more difficult
to automatically popup an interactive color dialog AND try to deal with a
transparency option too.

Michael


On 5/16/07 11:20 PM, "Hamish" <hamish_nospam at yahoo.com> wrote:

> Paul Kelly wrote:
>> Actually in light of this I don't see any reason why not to change
>> d.histogram back to the old behaviour. The worst that can happen is
>> the  histogram is drawn over a map already in a display, but all that
>> needs  done then is d.erase or d.frame -e and repeat the d.histogram
>> command. But  the big gain is a histogram plot with a transparent
>> background. I'll make  the change some time before too long if nobody
>> objects. Or we could add a  new flag that doesn't erase and always run
>> it from the GUI with that flag  set. I prefer the simplicity of just
>> changing it back though (and thus  restoring its behaviour to be in
>> accordance with the man page).
> 
> I would prefer to add a background color option to d.histogram, with a
> default of DEFAULT_BG_COLOR and an option of "none".
> 
> Then remove the D_setup() clear flag and draw a rectangle of said color
> (or none) that fills the window prior to anything else.
> 
> I will do this shortly. (bonus: color= -> RGB)
> 
> This doesn't solve the general problem of swapping DEFAULT_FG and
> BG_COLOR without a recompile, unless you want all the xmon mapping done
> that way.
> 
> But I think that d.histogram is the only non-mapping function left that
> matters anymore:
>  d.profile is replaced by a much nicer Tcl version,
>  d.linegraph is better done using gnuplot's PS or SVG drivers
>   (+GhostScript/ svg2*).
> 
> so a module specific change isn't so bad.
> 
> I'll also fix the outdated reference in the man page.
> 
> 
> Hamish
> 
> 

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-dev mailing list