[GRASS5] Suggested color function names

Cedric Shock cedricgrass at shockfamily.net
Fri Apr 21 19:58:48 EDT 2006


Hi,

Hamish added a red, green, blue, alpha color structure to gis.h.

I'd like to add the following to gis.h as well:

/* RGBA_Color set values */
#define RGBA_COLOR_SET    1
#define RGBA_COLOR_UNSET  0
#define RGBA_COLOR_NONE  -1

I also think it would be apropos to add some more functions that deal with 
this structure instead of red, green, and blue integers. New functions means 
new names. My current best idea is adding RGBA to the existing analogous 
names.

We currently have

int G_str_to_color (str * name, int * red, int * green, int * blue);
int R_RGB_color(unsigned char,unsigned char,unsigned char);
int R_reset_color(unsigned char,unsigned char,unsigned char,int);
int R_reset_colors(int,int,unsigned char *,unsigned char *,unsigned char *);

How are these suggested names for new "functions":

int G_str_to_RGBA_color (str * name, RGBA_Color * color);
int R_RGBA_color(RGBA_Color * color);
int R_reset_RGBA_color(RGBA_Color * color, int);
int R_reset_colors(int,int,RGBA_Color ** colors);

The R_ functions would just use the existing protocol (no alpha support).

--Cedric




More information about the grass-dev mailing list