[GRASS5] r.colors bug

GRASS 5.7 (probably also 5.3),

$ARCH/etc/colors/gyr:
0% green
50% yellow
100% red

r.colors map=pok color=gyr

-> colr/pok
% 0 255
0:0:255:0 127.5:255:255:0
127.5:255:255:0 255:255:0:0
0:255

i.e. 0 set to white.

Radim

Radim Blazek wrote:

GRASS 5.7 (probably also 5.3),

$ARCH/etc/colors/gyr:
0% green
50% yellow
100% red

r.colors map=pok color=gyr

-> colr/pok
% 0 255
0:0:255:0 127.5:255:255:0
127.5:255:255:0 255:255:0:0
0:255

i.e. 0 set to white.

Unless someone has changed it, the color= option uses the coded rules;
e.g. color=gyr uses G_make_gyr_fp_colors(), which has the hardcoded
0=white rule.

IOW this bug/feature is in the various G_make_*_colors() functions in
libgis.

--
Glynn Clements <glynn.clements@virgin.net>

Radim Blazek wrote:

> GRASS 5.7 (probably also 5.3),
>
> $ARCH/etc/colors/gyr:
> 0% green
> 50% yellow
> 100% red
>
> r.colors map=pok color=gyr
>
> -> colr/pok
> % 0 255
> 0:0:255:0 127.5:255:255:0
> 127.5:255:255:0 255:255:0:0
> 0:255
>
> i.e. 0 set to white.

Unless someone has changed it, the color= option uses the coded rules;
e.g. color=gyr uses G_make_gyr_fp_colors(), which has the hardcoded
0=white rule.

IOW this bug/feature is in the various G_make_*_colors() functions in
libgis.

Note that the 'r.colors rules=gyr' version has had the '0 white' removed
already. Presumably we can now remove this pre-NULL code from libgis as
well?

Hamish

On Thursday 27 May 2004 10:54, Hamish wrote:

> Unless someone has changed it, the color= option uses the coded rules;
> e.g. color=gyr uses G_make_gyr_fp_colors(), which has the hardcoded
> 0=white rule.
>
> IOW this bug/feature is in the various G_make_*_colors() functions in
> libgis.

Note that the 'r.colors rules=gyr' version has had the '0 white' removed
already. Presumably we can now remove this pre-NULL code from libgis as
well?

I have already removed that in 5.7.

Radim

> > Unless someone has changed it, the color= option uses the coded rules;
> > e.g. color=gyr uses G_make_gyr_fp_colors(), which has the hardcoded
> > 0=white rule.
> >
> > IOW this bug/feature is in the various G_make_*_colors() functions in
> > libgis.
>
> Note that the 'r.colors rules=gyr' version has had the '0 white' removed
> already. Presumably we can now remove this pre-NULL code from libgis as
> well?

I have already removed that in 5.7.

Radim

Now done in 5.3 as well.

Hamish