[GRASS5] R_color vs R_standard_color

Cedric Shock cedricgrass at shockfamily.net
Mon Apr 17 19:16:48 EDT 2006


Hello,

Is there any real difference between R_color and R_standard_color?

Take this example (d.bargraph's background color):

int color1;
const int customBGcolor = MAXCOLORS + 2;

...

Then either

R_reset_color(customBGcolor, R, G, B);
color1 = customBGcolor;

or (essentially)

color1 = D_translate_color (...);

happens. So now color1 is either a number on the range 1 to MAXCOLORS if the 
color came from translate_color, or it's MAXCOLORS + 2 if a color was 
provided and set. Later, when drawing the box, the following is done:

if(color1 > MAXCOLORS)	/* ie custom RGB color */
    R_color(color1);
else
    R_standard_color(color1);

Is this because:

a.) colors and standard colors really are completely separate but both are 
being handled using a single integer with a divided range than a struct.

b.) In the past they were different but now they are the same.

c.) Something else I'm failing to imagine.

Thanks,

--Cedric




More information about the grass-dev mailing list