Преглед изворни кода

color_str.c moved back to libgis (modules fixed)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38069 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa пре 16 година
родитељ
комит
8db528aa65

+ 2 - 2
display/d.extract/main.c

@@ -78,14 +78,14 @@ int main(int argc, char **argv)
 	G_fatal_error(_("No graphics device selected"));
 
     color = G_standard_color_rgb(BLACK);
-    if (Rast_str_to_color(color_opt->answer, &r, &g, &b)) {
+    if (G_str_to_color(color_opt->answer, &r, &g, &b)) {
 	color.r = r;
 	color.g = g;
 	color.b = b;
     }
 
     hcolor = G_standard_color_rgb(RED);
-    if (Rast_str_to_color(hcolor_opt->answer, &r, &g, &b)) {
+    if (G_str_to_color(hcolor_opt->answer, &r, &g, &b)) {
 	hcolor.r = r;
 	hcolor.g = g;
 	hcolor.b = b;

+ 3 - 3
display/d.graph/do_graph.c

@@ -99,7 +99,7 @@ int do_color(const char *str)
     }
 
     /* Parse and select color */
-    color = Rast_str_to_color(in_color, &R, &G, &B);
+    color = G_str_to_color(in_color, &R, &G, &B);
     if (color == 0) {
 	G_warning(_("[%s]: No such color"), in_color);
 	/* store for backup */
@@ -339,7 +339,7 @@ int do_symbol(const char *str)
     size *= yincr;
 
     /* parse line color */
-    ret = Rast_str_to_color(line_color_str, &R, &G, &B);
+    ret = G_str_to_color(line_color_str, &R, &G, &B);
     line_color->r = (unsigned char)R;
     line_color->g = (unsigned char)G;
     line_color->b = (unsigned char)B;
@@ -356,7 +356,7 @@ int do_symbol(const char *str)
     }
 
     /* parse fill color */
-    ret = Rast_str_to_color(fill_color_str, &R, &G, &B);
+    ret = G_str_to_color(fill_color_str, &R, &G, &B);
     fill_color->r = (unsigned char)R;
     fill_color->g = (unsigned char)G;
     fill_color->b = (unsigned char)B;

+ 1 - 1
display/d.graph/main.c

@@ -101,7 +101,7 @@ int main(int argc, char **argv)
 
     /* Parse and select color */
     if (opt2->answer != NULL) {
-	color = Rast_str_to_color(opt2->answer, &R, &G, &B);
+	color = G_str_to_color(opt2->answer, &R, &G, &B);
 
 	if (color == 0)
 	    G_fatal_error(_("[%s]: No such color"), opt2->answer);

+ 1 - 1
display/d.grid/fiducial.c

@@ -34,7 +34,7 @@ void plot_symbol(double easting, double northing, int color, double rotation,
 
     if (D_color_number_to_RGB(color, &R, &G, &B) == 0)
 	/* fall back to black on failure */
-	Rast_str_to_color(DEFAULT_FG_COLOR, &R, &G, &B);
+	G_str_to_color(DEFAULT_FG_COLOR, &R, &G, &B);
 
     line_color->r = (unsigned char)R;
     line_color->g = (unsigned char)G;

+ 1 - 1
display/d.labels/color.c

@@ -53,7 +53,7 @@ int set_RGBA_from_str(RGBA_Color * color, const char *clr_str)
     int r, g, b;
     int ret;
 
-    ret = Rast_str_to_color(clr_str, &r, &g, &b);
+    ret = G_str_to_color(clr_str, &r, &g, &b);
 
     if (ret == 1) {
 	color->a = RGBA_COLOR_OPAQUE;

+ 3 - 3
display/d.path/main.c

@@ -153,21 +153,21 @@ int main(int argc, char **argv)
 	G_fatal_error(_("No graphics device selected"));
 
     color = G_standard_color_rgb(BLACK);
-    if (Rast_str_to_color(color_opt->answer, &r, &g, &b)) {
+    if (G_str_to_color(color_opt->answer, &r, &g, &b)) {
 	color.r = r;
 	color.g = g;
 	color.b = b;
     }
 
     hcolor = G_standard_color_rgb(RED);
-    if (Rast_str_to_color(hcolor_opt->answer, &r, &g, &b)) {
+    if (G_str_to_color(hcolor_opt->answer, &r, &g, &b)) {
 	hcolor.r = r;
 	hcolor.g = g;
 	hcolor.b = b;
     }
 
     bgcolor = G_standard_color_rgb(WHITE);
-    if (Rast_str_to_color(bgcolor_opt->answer, &r, &g, &b)) {
+    if (G_str_to_color(bgcolor_opt->answer, &r, &g, &b)) {
 	bgcolor.r = r;
 	bgcolor.g = g;
 	bgcolor.b = b;

+ 1 - 1
display/d.rast/display.c

@@ -22,7 +22,7 @@ int display(const char *name,
 	G_fatal_error(_("Color file for <%s> not available"), name);
 
     if (bg) {
-	if (Rast_str_to_color(bg, &r, &g, &b) != 1) {
+	if (G_str_to_color(bg, &r, &g, &b) != 1) {
 	    G_warning(_("[%s]: No such color"), bg);
 	    r = g = b = 255;
 	}

+ 2 - 2
display/d.thematic.area/main.c

@@ -272,7 +272,7 @@ int main(int argc, char **argv)
 
     /*get border line color */
     bcolor = G_standard_color_rgb(WHITE);
-    ret = Rast_str_to_color(bcolor_opt->answer, &r, &g, &b);
+    ret = G_str_to_color(bcolor_opt->answer, &r, &g, &b);
     if (ret == 1) {
 	has_color = 1;
 	bcolor.r = r;
@@ -347,7 +347,7 @@ int main(int argc, char **argv)
 		G_fatal_error(_("Not enough colors or error in color specifications.\nNeed %i colors."),
 			      nclass);
 
-	    ret = Rast_str_to_color(colors_opt->answers[i], &r, &g, &b);
+	    ret = G_str_to_color(colors_opt->answers[i], &r, &g, &b);
 	    if (!ret)
 		G_fatal_error(_("Error interpreting color %s"),
 			      colors_opt->answers[i]);

+ 1 - 1
display/d.thematic.area/plot1.c

@@ -267,7 +267,7 @@ int plot1(struct Map_info *Map, int type, int area, struct cat_list *Clist,
 			G_debug(3, "element %d: colorstring: %s", line,
 				colorstring);
 
-			if (Rast_str_to_color(colorstring, &red, &grn, &blu) ==
+			if (G_str_to_color(colorstring, &red, &grn, &blu) ==
 			    1) {
 			    custom_rgb = TRUE;
 			    G_debug(3, "element:%d  cat %d r:%d g:%d b:%d",

+ 2 - 2
display/d.vect.chart/main.c

@@ -171,7 +171,7 @@ int main(int argc, char **argv)
     field = atoi(field_opt->answer);
 
     /* Outline color */
-    ret = Rast_str_to_color(ocolor_opt->answer, &r, &g, &b);
+    ret = G_str_to_color(ocolor_opt->answer, &r, &g, &b);
     if (ret == 1) {
 	ocolor.none = 0;
 	ocolor.r = r;
@@ -215,7 +215,7 @@ int main(int argc, char **argv)
 	    if (colors_opt->answers[i] == NULL)
 		break;
 
-	    ret = Rast_str_to_color(colors_opt->answers[i], &r, &g, &b);
+	    ret = G_str_to_color(colors_opt->answers[i], &r, &g, &b);
 	    if (ret == 1) {
 		colors[i].none = 0;
 		colors[i].r = r;

+ 1 - 1
display/d.vect/area.c

@@ -267,7 +267,7 @@ int darea(struct Map_info *Map, struct cat_list *Clist,
 			G_debug(3, "area %d: colorstring: %s", area,
 				colorstring);
 
-			if (Rast_str_to_color(colorstring, &red, &grn, &blu) ==
+			if (G_str_to_color(colorstring, &red, &grn, &blu) ==
 			    1) {
 			    rgb = 1;
 			    G_debug(3, "area:%d  cat %d r:%d g:%d b:%d", area,

+ 5 - 5
display/d.vect/main.c

@@ -393,7 +393,7 @@ int main(int argc, char **argv)
     }
 
     color = G_standard_color_rgb(WHITE);
-    ret = Rast_str_to_color(color_opt->answer, &r, &g, &b);
+    ret = G_str_to_color(color_opt->answer, &r, &g, &b);
     if (ret == 1) {
 	has_color = 1;
 	color.r = r;
@@ -408,7 +408,7 @@ int main(int argc, char **argv)
     }
 
     fcolor = G_standard_color_rgb(WHITE);
-    ret = Rast_str_to_color(fcolor_opt->answer, &r, &g, &b);
+    ret = G_str_to_color(fcolor_opt->answer, &r, &g, &b);
     if (ret == 1) {
 	has_fcolor = 1;
 	fcolor.r = r;
@@ -533,20 +533,20 @@ int main(int argc, char **argv)
 	lattr.field = Clist->field;
 
     lattr.color.R = lattr.color.G = lattr.color.B = 255;
-    if (Rast_str_to_color(lcolor_opt->answer, &r, &g, &b)) {
+    if (G_str_to_color(lcolor_opt->answer, &r, &g, &b)) {
 	lattr.color.R = r;
 	lattr.color.G = g;
 	lattr.color.B = b;
     }
     lattr.has_bgcolor = 0;
-    if (Rast_str_to_color(bgcolor_opt->answer, &r, &g, &b) == 1) {
+    if (G_str_to_color(bgcolor_opt->answer, &r, &g, &b) == 1) {
 	lattr.has_bgcolor = 1;
 	lattr.bgcolor.R = r;
 	lattr.bgcolor.G = g;
 	lattr.bgcolor.B = b;
     }
     lattr.has_bcolor = 0;
-    if (Rast_str_to_color(bcolor_opt->answer, &r, &g, &b) == 1) {
+    if (G_str_to_color(bcolor_opt->answer, &r, &g, &b) == 1) {
 	lattr.has_bcolor = 1;
 	lattr.bcolor.R = r;
 	lattr.bcolor.G = g;

+ 1 - 1
display/d.vect/plot1.c

@@ -284,7 +284,7 @@ int plot1(struct Map_info *Map, int type, int area, struct cat_list *Clist,
 			G_debug(3, "element %d: colorstring: %s", line,
 				colorstring);
 
-			if (Rast_str_to_color(colorstring, &red, &grn, &blu) ==
+			if (G_str_to_color(colorstring, &red, &grn, &blu) ==
 			    1) {
 			    custom_rgb = TRUE;
 			    G_debug(3, "element:%d  cat %d r:%d g:%d b:%d",

+ 7 - 0
include/gisdefs.h

@@ -117,6 +117,13 @@ void G_clear_screen(void);
 /* clicker.c */
 void G_clicker(void);
 
+/* color_str.c */
+int G_num_standard_colors(void);
+struct color_rgb G_standard_color_rgb(int);
+int G_num_standard_color_names(void);
+const struct color_name *G_standard_color_name(int);
+int G_str_to_color(const char *, int *, int *, int *);
+
 /* commas.c */
 int G_insert_commas(char *);
 void G_remove_commas(char *);

+ 0 - 3
include/raster.h

@@ -250,9 +250,6 @@ void Rast_set_default_color(int, int, int, struct Colors *);
 void Rast_shift_colors(int, struct Colors *);
 void Rast_shift_d_colors(DCELL, struct Colors *);
 
-/* color_str.c */
-int Rast_str_to_color(const char *, int *, int *, int *);
-
 /* color_write.c */
 int Rast_write_colors(const char *, const char *, struct Colors *);
 void Rast__write_colors(FILE *, struct Colors *);

+ 1 - 1
lib/display/tran_colr.c

@@ -57,7 +57,7 @@ static int translate_or_add_color(const char *str)
 	    colors[i] = G_standard_color_rgb(i);
     }
 
-    ret = Rast_str_to_color(str, &red, &grn, &blu);
+    ret = G_str_to_color(str, &red, &grn, &blu);
 
     /* None color */
     if (ret == 2)

+ 4 - 4
lib/raster/color_str.c

@@ -1,7 +1,7 @@
 /*!
-   \file color_str.c
+   \file gis/color_str.c
 
-   \brief Raster library - color management, named color to RGB triplet
+   \brief GIS library - color management, named color to RGB triplet
 
    (C) 2001-2008 by the GRASS Development Team
 
@@ -109,7 +109,7 @@ const struct color_name *G_standard_color_name(int n)
    \return 2 NONE 
    \return 0 on error 
  */
-int Rast_str_to_color(const char *str, int *red, int *grn, int *blu)
+int G_str_to_color(const char *str, int *red, int *grn, int *blu)
 {
     char buf[100];
     int num_names = G_num_standard_color_names();
@@ -118,7 +118,7 @@ int Rast_str_to_color(const char *str, int *red, int *grn, int *blu)
     strcpy(buf, str);
     G_chop(buf);
 
-    G_debug(3, "Rast_str_to_color(): str = '%s'", buf);
+    G_debug(3, "G_str_to_color(): str = '%s'", buf);
 
     if (G_strcasecmp(buf, "NONE") == 0)
 	return 2;

+ 1 - 1
lib/nviz/nviz.c

@@ -73,7 +73,7 @@ int Nviz_color_from_str(const char *color_str)
 {
     int red, grn, blu;
 
-    if (Rast_str_to_color(color_str, &red, &grn, &blu) != 1) {
+    if (G_str_to_color(color_str, &red, &grn, &blu) != 1) {
 	G_warning(_("Invalid color (%s), using \"white\" as default"),
 		  color_str);
 	red = grn = blu = 255;

+ 2 - 2
lib/raster/color_hist.c

@@ -40,7 +40,7 @@ void Rast_make_histogram_eq_colors(struct Colors *colors,
 
     Rast_init_colors(colors);
 
-    Rast_str_to_color(DEFAULT_BG_COLOR, &R, &G, &B);
+    G_str_to_color(DEFAULT_BG_COLOR, &R, &G, &B);
     Rast_set_null_value_color(R, G, B, colors);
 
     total = 0;
@@ -108,7 +108,7 @@ void Rast_make_histogram_log_colors(struct Colors *colors,
 
     Rast_init_colors(colors);
 
-    Rast_str_to_color(DEFAULT_BG_COLOR, &R, &G, &B);
+    G_str_to_color(DEFAULT_BG_COLOR, &R, &G, &B);
     Rast_set_null_value_color(R, G, B, colors);
 
     total = 0;

+ 4 - 4
ps/ps.map/do_labels.c

@@ -239,7 +239,7 @@ int do_label(FILE * fd, int font_override)
 	}
 
 	if (FIELD("color")) {
-	    ret = Rast_str_to_color(value, &r, &g, &b);
+	    ret = G_str_to_color(value, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&color, r, g, b);
 	    else
@@ -249,7 +249,7 @@ int do_label(FILE * fd, int font_override)
 	}
 
 	if (FIELD("hcolor")) {
-	    ret = Rast_str_to_color(value, &r, &g, &b);
+	    ret = G_str_to_color(value, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&hcolor, r, g, b);
 	    else if (ret == 2)
@@ -280,7 +280,7 @@ int do_label(FILE * fd, int font_override)
 	    /*
 	       if(strncmp(value, "none", 4)==0) opaque = 0;
 	     */
-	    ret = Rast_str_to_color(value, &r, &g, &b);
+	    ret = G_str_to_color(value, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&background, r, g, b);
 	    else if (ret == 2)
@@ -290,7 +290,7 @@ int do_label(FILE * fd, int font_override)
 	}
 
 	if (FIELD("border")) {
-	    ret = Rast_str_to_color(value, &r, &g, &b);
+	    ret = G_str_to_color(value, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&border, r, g, b);
 	    else if (ret == 2)

+ 1 - 1
ps/ps.map/main.c

@@ -712,7 +712,7 @@ int main(int argc, char *argv[])
 	if (KEY("maskcolor")) {
 	    int ret, r, g, b;
 
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		PS.mask_r = r / 255.0;
 		PS.mask_g = g / 255.0;

+ 1 - 1
ps/ps.map/ps_vareas.c

@@ -104,7 +104,7 @@ int get_ps_color_rgbcol_varea(struct Map_info *map, int vec, int area,
     else {
 	rgbstring = db_get_string(cv_rgb->val.s);
 	if (rgbstring == NULL ||
-	    Rast_str_to_color(rgbstring, &red, &grn, &blu) != 1) {
+	    G_str_to_color(rgbstring, &red, &grn, &blu) != 1) {
 	    G_warning(_("Invalid RGB color definition in column <%s> for category [%d]"),
 		      vector.layer[vec].rgbcol, cat);
 	    rgbstring = NULL;

+ 1 - 1
ps/ps.map/ps_vlines.c

@@ -121,7 +121,7 @@ int PS_vlines_plot(struct Map_info *P_map, int vec, int type)
 	    else {
 		rgbstring = db_get_string(cv_rgb->val.s);
 		if (rgbstring == NULL ||
-		    Rast_str_to_color(rgbstring, &red, &grn, &blu) != 1) {
+		    G_str_to_color(rgbstring, &red, &grn, &blu) != 1) {
 		    G_warning(_("Invalid RGB color definition in column <%s> for category [%d]"),
 			      vector.layer[vec].rgbcol, cat);
 		    rgbstring = NULL;

+ 1 - 1
ps/ps.map/ps_vpoints.c

@@ -202,7 +202,7 @@ int PS_vpoints_plot(struct Map_info *P_map, int vec, int type)
 	    else {
 		rgbstring = db_get_string(cv_rgb->val.s);
 		if (rgbstring == NULL ||
-		    Rast_str_to_color(rgbstring, &red, &grn, &blu) != 1) {
+		    G_str_to_color(rgbstring, &red, &grn, &blu) != 1) {
 		    G_warning(_("Invalid RGB color definition in column <%s> for category [%d]"),
 			      vector.layer[vec].rgbcol, cat);
 		    rgbstring = NULL;

+ 1 - 1
ps/ps.map/r_border.c

@@ -44,7 +44,7 @@ int read_border(void)
 	    continue;
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		color_R = r / 255.;
 		color_G = g / 255.;

+ 5 - 5
ps/ps.map/r_plt.c

@@ -45,7 +45,7 @@ int read_point(double e, double n)
 	    continue;
 	}
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		color_R = r;
 		color_G = g;
@@ -59,7 +59,7 @@ int read_point(double e, double n)
 	    continue;
 	}
 	if (KEY("fcolor")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		fcolor_R = r;
 		fcolor_G = g;
@@ -221,7 +221,7 @@ int read_line(double e1, double n1, double e2, double n2)
 	}
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		color_R = r;
 		color_G = g;
@@ -293,7 +293,7 @@ int read_rectangle(double e1, double n1, double e2, double n2)
 	}
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		color_R = r;
 		color_G = g;
@@ -308,7 +308,7 @@ int read_rectangle(double e1, double n1, double e2, double n2)
 	}
 
 	if (KEY("fcolor")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		fcolor_R = r;
 		fcolor_G = g;

+ 4 - 4
ps/ps.map/r_text.c

@@ -98,7 +98,7 @@ int read_text(char *east, char *north, char *text)
 	}
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&color, r, g, b);
 	    else if (ret == 2)
@@ -110,7 +110,7 @@ int read_text(char *east, char *north, char *text)
 	}
 
 	if (KEY("hcolor")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&hcolor, r, g, b);
 	    else if (ret == 2)
@@ -124,7 +124,7 @@ int read_text(char *east, char *north, char *text)
 	}
 
 	if (KEY("background")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&background, r, g, b);
 	    else if (ret == 2) {
@@ -138,7 +138,7 @@ int read_text(char *east, char *north, char *text)
 	}
 
 	if (KEY("border")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&border, r, g, b);
 	    else if (ret == 2)

+ 2 - 2
ps/ps.map/r_vareas.c

@@ -126,7 +126,7 @@ int read_vareas(char *name, char *mapset)
 	}
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&(vector.layer[vec].color), r, g, b);
 	    else if (ret == 2)
@@ -144,7 +144,7 @@ int read_vareas(char *name, char *mapset)
 	}
 
 	if (KEY("fcolor")) {	/* area color */
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&(vector.layer[vec].fcolor), r, g, b);
 	    else if (ret == 2)

+ 2 - 2
ps/ps.map/r_vlines.c

@@ -248,7 +248,7 @@ int read_vlines(char *name, char *mapset)
 	}
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&(vector.layer[vec].color), r, g, b);
 	    else if (ret == 2)
@@ -266,7 +266,7 @@ int read_vlines(char *name, char *mapset)
 	}
 
 	if (KEY("hcolor")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&(vector.layer[vec].hcolor), r, g, b);
 	    else if (ret == 2)

+ 2 - 2
ps/ps.map/r_vpoints.c

@@ -149,7 +149,7 @@ int read_vpoints(char *name, char *mapset)
 	}
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&(vector.layer[vec].color), r, g, b);
 	    else if (ret == 2)
@@ -161,7 +161,7 @@ int read_vpoints(char *name, char *mapset)
 	}
 
 	if (KEY("fcolor")) {	/* fill color */
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1)
 		set_color(&(vector.layer[vec].fcolor), r, g, b);
 	    else if (ret == 2)

+ 1 - 1
ps/ps.map/r_wind.c

@@ -54,7 +54,7 @@ int read_wind(char *name, char *mapset)
 
 
 	if (KEY("color")) {
-	    ret = Rast_str_to_color(data, &r, &g, &b);
+	    ret = G_str_to_color(data, &r, &g, &b);
 	    if (ret == 1) {
 		color_R = r;
 		color_G = g;

+ 1 - 1
vector/v.to.rast/support.c

@@ -163,7 +163,7 @@ int update_dbcolors(const char *rast_name, const char *vector_map, int field,
 	if (*colorstring != '\0') {
 	    G_debug(3, "element colorstring: %s", colorstring);
 
-	    if (Rast_str_to_color(colorstring, &red, &grn, &blu) == 1) {
+	    if (G_str_to_color(colorstring, &red, &grn, &blu) == 1) {
 		G_debug(3, "cat %d r:%d g:%d b:%d", cat, red, grn, blu);
 	    }
 	    else {