Specify color as #RRGGBB

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Specify color as #RRGGBB

wenzeslaus
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

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specify color as #RRGGBB

Martin Landa
Hi,

2016-10-07 1:58 GMT+02:00 Vaclav Petras <[hidden email]>:
> Now instead of
>
> d.vect map=hospitals color=80:170:255
>
> you can do this:
>
> d.vect map=hospitals color=#50AAFF

great! Good idea, Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specify color as #RRGGBB

Moritz Lennert



Le 7 octobre 2016 09:50:16 GMT+02:00, Martin Landa <[hidden email]> a écrit :

>Hi,
>
>2016-10-07 1:58 GMT+02:00 Vaclav Petras <[hidden email]>:
>> Now instead of
>>
>> d.vect map=hospitals color=80:170:255
>>
>> you can do this:
>>
>> d.vect map=hospitals color=#50AAFF
>
>great! Good idea, Martin

Very helpful indeed. Thanks !

Moritz

>
>--
>Martin Landa
>http://geo.fsv.cvut.cz/gwiki/Landa
>http://gismentors.cz/mentors/landa
>_______________________________________________
>grass-dev mailing list
>[hidden email]
>http://lists.osgeo.org/mailman/listinfo/grass-dev

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev