[GRASS-dev] postscript color output

Hi,

ps.map (legends) output colors as

if(do_color)
  fprintf(PS.fp, "%.2f %.2f %.2f C\n",
            (double)R/255., (double)G/255., (double)B/255.);
else {
  grey_color_val = (.3 * (double)R + .59 * (double)G
                     + .11 * (double)B)/255.;
  fprintf(PS.fp, "%.2f setgray\n", grey_color_val);
}

"0.00" is only 100 levels; should these be changed to %.3f so none of
the 256 color resolution is lost?

Hamish

Hamish wrote:

ps.map (legends) output colors as

if(do_color)
  fprintf(PS.fp, "%.2f %.2f %.2f C\n",
            (double)R/255., (double)G/255., (double)B/255.);
else {
  grey_color_val = (.3 * (double)R + .59 * (double)G
                     + .11 * (double)B)/255.;
  fprintf(PS.fp, "%.2f setgray\n", grey_color_val);
}

"0.00" is only 100 levels; should these be changed to %.3f so none of
the 256 color resolution is lost?

Yes.

--
Glynn Clements <glynn@gclements.plus.com>