[GRASS-dev] Specify color as #RRGGBB

Vaclav Petras wenzeslaus at gmail.com
Thu Oct 6 16:58:58 PDT 2016


Dear all,

in r69683 I've added few lines to support colors hexadecimal numbers for
colors when prefixed by hash. That's the syntax often used in HTML (CSS)
and by other programs and formats.

Now instead of

d.vect map=hospitals color=80:170:255

you can do this:

d.vect map=hospitals color=#50AAFF

which is useful when you are copy pasting colors from somewhere (like the
gcolor2).

The limit is that it works only for the places where G_str_to_color() is
used. Most notably it doesn't work in r.colors' rules file.

This can help with writing scripts but be aware that # starts a comment in
Bash, so use quotes.

Please comment,
Vaclav


https://trac.osgeo.org/grass/changeset/69683
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20161006/36613b3f/attachment.html>


More information about the grass-dev mailing list