in r69708, I’ve changed the implementation of parsing color rules to use the G_str_to_color() function instead of a custom mechanism. This, in connection with r69683, adds the possibility to use HTML (CSS) style of hexadecimal colors with leading hash.
Where it gets little tricky is that hash is used to comment a line in color rules/color table format. A comment is now implemented as a line where first character is hash, so there is no interference. We just need to keep it that way.
The comments (# …) are actually not documented in r.colors manual. Same goes also for the syntax with space as a separator instead of colon. Now we also support ; and , as separators (because that’s what G_str_to_color() supports). The hash syntax keeps tradition and it is undocumented as well for now (but there is a test!).
On Thu, Oct 20, 2016 at 12:20 AM, Vaclav Petras <wenzeslaus@gmail.com> wrote:
Dear all,
in r69708, I've changed the implementation of parsing color rules to use the
G_str_to_color() function instead of a custom mechanism. This, in connection
with r69683, adds the possibility to use HTML (CSS) style of hexadecimal
colors with leading hash.
Where it gets little tricky is that hash is used to comment a line in color
rules/color table format. A comment is now implemented as a line where first
character is hash, so there is no interference. We just need to keep it that
way.
The comments (# ...) are actually not documented in r.colors manual.
I just tested it with a soil map, great job!
Same goes also for the syntax with space as a separator instead of colon. Now we
also support ; and , as separators (because that's what G_str_to_color()
supports). The hash syntax keeps tradition and it is undocumented as well
for now (but there is a test!).