[goffice] renamed go-color.h macros



commit 90a04ad59c1df7b2714f976a807f691eddb0977a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Sep 5 12:39:09 2009 +0200

    renamed go-color.h macros

 ChangeLog                          |    4 +
 goffice/canvas/goc-circle.c        |    4 +-
 goffice/canvas/goc-ellipse.c       |    4 +-
 goffice/canvas/goc-line.c          |    2 +-
 goffice/canvas/goc-polygon.c       |    4 +-
 goffice/canvas/goc-polyline.c      |    2 +-
 goffice/canvas/goc-rectangle.c     |    4 +-
 goffice/graph/gog-equation.c       |    8 +-
 goffice/graph/gog-error-bar.c      |    8 +-
 goffice/graph/gog-theme.c          |   98 ++++++++++++++--------------
 goffice/gtk/go-3d-rotation-sel.c   |   10 ++--
 goffice/gtk/go-color-group.c       |    2 +-
 goffice/gtk/go-color-palette.c     |  130 ++++++++++++++++++------------------
 goffice/gtk/go-color-selector.c    |   36 +++++-----
 goffice/gtk/go-combo-color.c       |    8 +-
 goffice/gtk/go-gradient-selector.c |    4 +-
 goffice/gtk/go-marker-selector.c   |    4 +-
 goffice/gtk/go-pattern-selector.c  |    8 +-
 goffice/gtk/go-rotation-sel.c      |    8 +-
 goffice/utils/go-color.c           |   16 ++--
 goffice/utils/go-color.h           |   81 ++++++++++-------------
 goffice/utils/go-format.c          |   32 +++++-----
 goffice/utils/go-image.c           |    4 +-
 goffice/utils/go-libxml-extras.c   |    4 +-
 goffice/utils/go-marker.c          |    4 +-
 goffice/utils/go-pattern.c         |   10 ++--
 goffice/utils/go-style.c           |   18 +++---
 plugins/plot_radar/gog-radar.c     |   12 ++--
 plugins/plot_surface/gog-contour.c |    4 +-
 plugins/plot_xy/gog-xy.c           |   14 ++--
 30 files changed, 270 insertions(+), 277 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f02ac00..560aaf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-09-05  Jean Brefort  <jean brefort normalesup org>
 
+	* all files: renamed go-color.h macros.
+
+2009-09-05  Jean Brefort  <jean brefort normalesup org>
+
 	* goffice/graph/gog-equation.c (gog_equation_finalize),
 	(gog_equation_view_finalize): call parent class finalize methods. [#594189]
 
diff --git a/goffice/canvas/goc-circle.c b/goffice/canvas/goc-circle.c
index 3cd2a5e..f3ba07e 100644
--- a/goffice/canvas/goc-circle.c
+++ b/goffice/canvas/goc-circle.c
@@ -140,11 +140,11 @@ goc_circle_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->line.auto_dash)
 		style->line.dash_type = GO_LINE_SOLID;
 	if (style->line.auto_color)
-		style->line.color = GO_RGBA_BLACK;
+		style->line.color = GO_COLOR_BLACK;
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 }
 
 static void
diff --git a/goffice/canvas/goc-ellipse.c b/goffice/canvas/goc-ellipse.c
index 97afcd1..7570aa8 100644
--- a/goffice/canvas/goc-ellipse.c
+++ b/goffice/canvas/goc-ellipse.c
@@ -193,11 +193,11 @@ goc_ellipse_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->line.auto_dash)
 		style->line.dash_type = GO_LINE_SOLID;
 	if (style->line.auto_color)
-		style->line.color = GO_RGBA_BLACK;
+		style->line.color = GO_COLOR_BLACK;
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 }
 
 static void
diff --git a/goffice/canvas/goc-line.c b/goffice/canvas/goc-line.c
index 64cf2b9..aadd955 100644
--- a/goffice/canvas/goc-line.c
+++ b/goffice/canvas/goc-line.c
@@ -241,7 +241,7 @@ goc_line_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->line.auto_dash)
 		style->line.dash_type = GO_LINE_SOLID;
 	if (style->line.auto_color)
-		style->line.color = GO_RGBA_BLACK;
+		style->line.color = GO_COLOR_BLACK;
 	if (style->line.auto_fore)
 		style->line.fore  = 0;
 }
diff --git a/goffice/canvas/goc-polygon.c b/goffice/canvas/goc-polygon.c
index cef83c1..732155d 100644
--- a/goffice/canvas/goc-polygon.c
+++ b/goffice/canvas/goc-polygon.c
@@ -205,11 +205,11 @@ goc_polygon_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->line.auto_dash)
 		style->line.dash_type = GO_LINE_SOLID;
 	if (style->line.auto_color)
-		style->line.color = GO_RGBA_BLACK;
+		style->line.color = GO_COLOR_BLACK;
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 }
 
 static void
diff --git a/goffice/canvas/goc-polyline.c b/goffice/canvas/goc-polyline.c
index f63db8b..ade0491 100644
--- a/goffice/canvas/goc-polyline.c
+++ b/goffice/canvas/goc-polyline.c
@@ -186,7 +186,7 @@ goc_polyline_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->line.auto_dash)
 		style->line.dash_type = GO_LINE_SOLID;
 	if (style->line.auto_color)
-		style->line.color = GO_RGBA_BLACK;
+		style->line.color = GO_COLOR_BLACK;
 }
 
 static void
diff --git a/goffice/canvas/goc-rectangle.c b/goffice/canvas/goc-rectangle.c
index 4325a8c..2f57896 100644
--- a/goffice/canvas/goc-rectangle.c
+++ b/goffice/canvas/goc-rectangle.c
@@ -174,11 +174,11 @@ goc_rectangle_init_style (G_GNUC_UNUSED GocStyledItem *item, GOStyle *style)
 	if (style->line.auto_dash)
 		style->line.dash_type = GO_LINE_SOLID;
 	if (style->line.auto_color)
-		style->line.color = GO_RGBA_BLACK;
+		style->line.color = GO_COLOR_BLACK;
 	if (style->fill.auto_type)
 		style->fill.type  = GO_STYLE_FILL_PATTERN;
 	if (style->fill.auto_fore)
-		go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+		go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 }
 
 static void
diff --git a/goffice/graph/gog-equation.c b/goffice/graph/gog-equation.c
index 0c962e2..554bab0 100644
--- a/goffice/graph/gog-equation.c
+++ b/goffice/graph/gog-equation.c
@@ -124,10 +124,10 @@ _update_equation_style (GogEquation *equation, const GOStyle *style)
 		return;
 
 	lsm_mathml_style_set_math_color (math_style,
-				      GO_DOUBLE_RGBA_R (style->font.color),
-				      GO_DOUBLE_RGBA_G (style->font.color),
-				      GO_DOUBLE_RGBA_B (style->font.color),
-				      GO_DOUBLE_RGBA_A (style->font.color));
+				      GO_COLOR_DOUBLE_R (style->font.color),
+				      GO_COLOR_DOUBLE_G (style->font.color),
+				      GO_COLOR_DOUBLE_B (style->font.color),
+				      GO_COLOR_DOUBLE_A (style->font.color));
 
 	font_description = style->font.font->desc;
 	if (font_description != NULL) {
diff --git a/goffice/graph/gog-error-bar.c b/goffice/graph/gog-error-bar.c
index bd71514..61dc568 100644
--- a/goffice/graph/gog-error-bar.c
+++ b/goffice/graph/gog-error-bar.c
@@ -225,7 +225,7 @@ gog_error_bar_prefs (GogSeries *series,
 		editor->width = editor->bar->width;
 		editor->display = editor->bar->display;
 	} else {
-		editor->color = GO_RGBA_BLACK;
+		editor->color = GO_COLOR_BLACK;
 		editor->line_width = 1.;
 		editor->width = 5.;
 		editor->display = GOG_ERROR_BAR_DISPLAY_BOTH;
@@ -253,7 +253,7 @@ gog_error_bar_prefs (GogSeries *series,
 	style_table = GTK_TABLE (gtk_builder_get_object (gui, "style_table"));
 
 	/* Color */
-	w = go_color_selector_new (editor->color, GO_RGBA_BLACK, "error-bar");
+	w = go_color_selector_new (editor->color, GO_COLOR_BLACK, "error-bar");
 	gtk_label_set_mnemonic_widget (
 		GTK_LABEL (gtk_builder_get_object (gui, "color_label")), w);
 	g_signal_connect (G_OBJECT (w),
@@ -333,7 +333,7 @@ gog_error_bar_init (GogErrorBar* bar)
 	bar->width = 5.;
 	bar->style = go_style_new ();
 	bar->style->interesting_fields = GO_STYLE_LINE;
-	bar->style->line.color = GO_RGBA_BLACK;
+	bar->style->line.color = GO_COLOR_BLACK;
 	bar->style->line.width = 1.;
 }
 
@@ -430,7 +430,7 @@ gog_error_bar_persist_sax_save (GOPersist const *gp, GsfXMLOut *output)
 		gsf_xml_out_add_float (output, "width", bar->width, 6);
 	if (bar->style->line.width != 1.)
 		gsf_xml_out_add_float (output, "line_width", bar->style->line.width, 6);
-	if (bar->style->line.color != GO_RGBA_BLACK)
+	if (bar->style->line.color != GO_COLOR_BLACK)
 		go_xml_out_add_color (output, "color", bar->style->line.color);
 }
 
diff --git a/goffice/graph/gog-theme.c b/goffice/graph/gog-theme.c
index 5f5b851..811e1d1 100644
--- a/goffice/graph/gog-theme.c
+++ b/goffice/graph/gog-theme.c
@@ -504,39 +504,39 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0;
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_NONE;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style, NULL, "GogGraph", NULL);
 
 	/* chart */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style, NULL, "GogChart", NULL);
 
 	/* Legend */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style, NULL, "GogLegend", NULL);
 
 	/* Axis */
 	style = go_style_new ();
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	gog_theme_add_element (theme, style, NULL, "GogAxis", NULL);
 
 	/* AxisLine */
 	style = go_style_new ();
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	gog_theme_add_element (theme, style, NULL, "GogAxisLine", NULL);
 
 	/* Grid */
@@ -545,22 +545,22 @@ _gog_themes_init (void)
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 1.;
 	style->line.color = 0X848284ff;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_GREY (0xd0));
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_GREY (0xd0));
 	gog_theme_add_element (theme, style, NULL, "GogGrid", NULL);
 
 	/* GridLine */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.4; 
-	style->line.color = GO_RGBA_BLACK;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_TO_UINT (0xE0, 0xE0, 0xE0, 0xE0));
+	style->line.color = GO_COLOR_BLACK;
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_RGBA (0xE0, 0xE0, 0xE0, 0xE0));
 	style->fill.type = GO_STYLE_FILL_NONE;
 	gog_theme_add_element (theme, style, NULL, NULL, "MajorGrid");
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.2; 
-	style->line.color = GO_RGBA_BLACK; 
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_TO_UINT (0xE0, 0xE0, 0xE0, 0xE0));
+	style->line.color = GO_COLOR_BLACK; 
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_RGBA (0xE0, 0xE0, 0xE0, 0xE0));
 	style->fill.type = GO_STYLE_FILL_NONE;
 	gog_theme_add_element (theme, style, NULL, NULL, "MinorGrid");
 	
@@ -568,7 +568,7 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
 	/* FIXME : not really true, will want to split area from line */
 	gog_theme_add_element (theme, style,
@@ -578,9 +578,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0.;
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_NONE;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	go_style_set_font_desc (style, pango_font_description_from_string ("Sans Bold 12"));
 	gog_theme_add_element (theme, style, NULL, "GogChart", "Title");
 
@@ -588,9 +588,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0.;
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_NONE;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	go_style_set_font_desc (style, pango_font_description_from_string ("Sans 10"));
 	gog_theme_add_element (theme, style, NULL, "GogLabel", NULL);
 
@@ -598,8 +598,8 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 1;
-	style->line.color = GO_RGBA_BLACK;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_TO_UINT (0x00, 0x00, 0x00, 0x20));
+	style->line.color = GO_COLOR_BLACK;
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_RGBA (0x00, 0x00, 0x00, 0x20));
 	style->fill.type = GO_STYLE_FILL_NONE;
 	gog_theme_add_element (theme, style,
 		NULL, "GogTrendLine", NULL);
@@ -608,9 +608,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style,
 		NULL, "GogRegEqn", NULL);
 
@@ -619,9 +619,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_NONE;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	go_style_set_font_desc (style, pango_font_description_from_string ("Sans 10"));
 	gog_theme_add_element (theme, style,
 		NULL, "GogEquation", NULL);
@@ -640,67 +640,67 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0; 
-	style->line.color = GO_RGBA_BLACK; 
+	style->line.color = GO_COLOR_BLACK; 
 	style->fill.type = GO_STYLE_FILL_GRADIENT;
 	style->fill.gradient.dir   = GO_GRADIENT_N_TO_S;
-	style->fill.pattern.fore = GO_RGBA_BLUE;
-	style->fill.pattern.back = GO_RGBA_BLACK;
+	style->fill.pattern.fore = GO_COLOR_BLUE;
+	style->fill.pattern.back = GO_COLOR_BLACK;
 	gog_theme_add_element (theme, style, NULL, "GogGraph", NULL);
 
 	/* chart */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style, NULL, "GogChart", NULL);
 
 	/* legend */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style, NULL, "GogLegend", NULL);
 
 	/* Axis */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.; /* hairline */
-	style->line.color = GO_RGBA_GREY (0x20);
+	style->line.color = GO_COLOR_GREY (0x20);
 	gog_theme_add_element (theme, style, NULL, "GogAxis", NULL);
 	
 	/* AxisLine */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.; /* hairline */
-	style->line.color = GO_RGBA_GREY (0x20);
+	style->line.color = GO_COLOR_GREY (0x20);
 	gog_theme_add_element (theme, style, NULL, "GogAxisLine", NULL);
 
 	/* Grid */
 	style = go_style_new ();
 	style->fill.type  = GO_STYLE_FILL_PATTERN;
 	style->line.dash_type = GO_LINE_NONE;
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->line.width = 0;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_GREY (0xd0));
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_GREY (0xd0));
 	gog_theme_add_element (theme, style, NULL, "GogGrid", NULL);
 
 	/* GridLine */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.; /* hairline */
-	style->line.color = GO_RGBA_GREY (0x96);
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_TO_UINT (0xE0, 0xE0, 0xE0, 0xE0));
+	style->line.color = GO_COLOR_GREY (0x96);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_RGBA (0xE0, 0xE0, 0xE0, 0xE0));
 	style->fill.type = GO_STYLE_FILL_NONE;
 	gog_theme_add_element (theme, style, NULL, NULL, "MajorGrid");
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.; /* hairline */
-	style->line.color = GO_RGBA_GREY (0xC0);
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_TO_UINT (0xE0, 0xE0, 0xE0, 0xE0));
+	style->line.color = GO_COLOR_GREY (0xC0);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_RGBA (0xE0, 0xE0, 0xE0, 0xE0));
 	style->fill.type = GO_STYLE_FILL_NONE;
 	gog_theme_add_element (theme, style, NULL, NULL, "MinorGrid");
 	
@@ -708,9 +708,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0.; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_GREY (0x20));
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_GREY (0x20));
 	/* FIXME : not really true, will want to split area from line */
 	gog_theme_add_element (theme, style,
 		map_area_series_solid_guppi, "GogSeries", NULL);
@@ -719,17 +719,17 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0; /* none */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_NONE;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style, NULL, "GogLabel", NULL);
 
 	/* trend lines */
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 1;
-	style->line.color = GO_RGBA_BLACK;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_TO_UINT (0x00, 0x00, 0x00, 0x20));
+	style->line.color = GO_COLOR_BLACK;
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_RGBA (0x00, 0x00, 0x00, 0x20));
 	style->fill.type = GO_STYLE_FILL_NONE;
 	gog_theme_add_element (theme, style,
 		NULL, "GogTrendLine", NULL);
@@ -738,9 +738,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_SOLID;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	gog_theme_add_element (theme, style,
 		NULL, "GogRegEqn", NULL);
 
@@ -749,9 +749,9 @@ _gog_themes_init (void)
 	style = go_style_new ();
 	style->line.dash_type = GO_LINE_NONE;
 	style->line.width = 0; /* hairline */
-	style->line.color = GO_RGBA_BLACK;
+	style->line.color = GO_COLOR_BLACK;
 	style->fill.type = GO_STYLE_FILL_NONE;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_WHITE);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_WHITE);
 	go_style_set_font_desc (style, pango_font_description_from_string ("Sans 10"));
 	gog_theme_add_element (theme, style,
 		NULL, "GogEquation", NULL);
diff --git a/goffice/gtk/go-3d-rotation-sel.c b/goffice/gtk/go-3d-rotation-sel.c
index 06f7952..915c63c 100644
--- a/goffice/gtk/go-3d-rotation-sel.c
+++ b/goffice/gtk/go-3d-rotation-sel.c
@@ -163,7 +163,7 @@ cb_rotation_changed (GO3DRotationSel *g3d)
 		style->fill.type = GO_STYLE_FILL_PATTERN;
 		style->fill.auto_back = FALSE;
 		/* set the background light blue or transparent */
-		style->fill.pattern.back = (i == 1)? GO_RGBA_TO_UINT (0xad, 0xd8, 0xe6, 0xff): 0;
+		style->fill.pattern.back = (i == 1)? GO_COLOR_FROM_RGBA (0xad, 0xd8, 0xe6, 0xff): 0;
 		style->line.width = (mean_y < 0) ? 4. : 0.5;
 		goc_item_set (g3d->cube_polygons[i], "points", points,
 		              "style", style, NULL);
@@ -209,7 +209,7 @@ cb_rotate_canvas_realize (GocCanvas *canvas, GO3DRotationSel *g3d)
 		        GOC_TYPE_POLYGON, NULL);
 		go_style = go_styled_object_get_style (GO_STYLED_OBJECT (g3d->cube_polygons[i]));
 		go_style->line.auto_color = FALSE;
-		go_style->line.color = GO_RGBA_BLACK;
+		go_style->line.color = GO_COLOR_BLACK;
 		go_style->line.miter_limit = 1.414;
 	}
 
@@ -217,7 +217,7 @@ cb_rotate_canvas_realize (GocCanvas *canvas, GO3DRotationSel *g3d)
 	                          "x", mgn, "y", mgn, "radius", (double) g3d->radius, NULL);
 	go_style = go_styled_object_get_style (GO_STYLED_OBJECT (g3d->dial));
 	go_style->line.auto_color = FALSE;
-	go_style->line.color = GO_RGBA_BLACK;
+	go_style->line.color = GO_COLOR_BLACK;
 	go_style->line.width = 2.;
 	go_style->fill.auto_type = FALSE;
 	go_style->fill.type = GO_STYLE_FILL_NONE;
@@ -226,12 +226,12 @@ cb_rotate_canvas_realize (GocCanvas *canvas, GO3DRotationSel *g3d)
 		GOC_TYPE_CIRCLE, "radius", (double) g3d->bank_dial_r, NULL);
 	go_style = go_styled_object_get_style (GO_STYLED_OBJECT (g3d->bank_dial));
 	go_style->line.auto_color = FALSE;
-	go_style->line.color = GO_RGBA_BLACK;
+	go_style->line.color = GO_COLOR_BLACK;
 	go_style->line.width = 3.;
 	go_style->fill.auto_type = FALSE;
 	go_style->fill.type = GO_STYLE_FILL_PATTERN;
 	go_style->fill.auto_back = FALSE;
-	go_style->fill.pattern.back = GO_RGBA_WHITE;
+	go_style->fill.pattern.back = GO_COLOR_WHITE;
 
 	cb_rotation_changed(g3d);	
 }
diff --git a/goffice/gtk/go-color-group.c b/goffice/gtk/go-color-group.c
index 50cea3b..5d01fe6 100644
--- a/goffice/gtk/go-color-group.c
+++ b/goffice/gtk/go-color-group.c
@@ -89,7 +89,7 @@ go_color_group_init (GOColorGroup *cg)
 	cg->name = NULL;
 	cg->context = NULL;
 	for (i = 0 ; i < GO_COLOR_GROUP_HISTORY_SIZE ; i++)
-		cg->history[i] = GO_RGBA_BLACK;
+		cg->history[i] = GO_COLOR_BLACK;
 }
 
 GSF_CLASS (GOColorGroup, go_color_group,
diff --git a/goffice/gtk/go-color-palette.c b/goffice/gtk/go-color-palette.c
index 8f7d530..a9bb3aa 100644
--- a/goffice/gtk/go-color-palette.c
+++ b/goffice/gtk/go-color-palette.c
@@ -73,71 +73,71 @@ enum {
 };
 
 GONamedColor const default_color_set [] = {
-	{ GO_RGBA_TO_UINT (0x00, 0x00, 0x00, 0xff), N_("black")},
-	{ GO_RGBA_TO_UINT (0x99, 0x33, 0x00, 0xff), N_("light brown")},
-	{ GO_RGBA_TO_UINT (0x33, 0x33, 0x00, 0xff), N_("brown gold")},
-	{ GO_RGBA_TO_UINT (0x00, 0x33, 0x00, 0xff), N_("dark green #2")},
-	{ GO_RGBA_TO_UINT (0x00, 0x33, 0x66, 0xff), N_("navy")},
-	{ GO_RGBA_TO_UINT (0x00, 0x00, 0x80, 0xff), N_("dark blue")},
-	{ GO_RGBA_TO_UINT (0x33, 0x33, 0x99, 0xff), N_("purple #2")},
-	{ GO_RGBA_TO_UINT (0x33, 0x33, 0x33, 0xff), N_("very dark gray")},
-
-	{ GO_RGBA_TO_UINT (0x80, 0x00, 0x00, 0xff), N_("dark red")},
-	{ GO_RGBA_TO_UINT (0xFF, 0x66, 0x00, 0xff), N_("red-orange")},
-	{ GO_RGBA_TO_UINT (0x80, 0x80, 0x00, 0xff), N_("gold")},
-	{ GO_RGBA_TO_UINT (0x00, 0x80, 0x00, 0xff), N_("dark green")},
-	{ GO_RGBA_TO_UINT (0x00, 0x80, 0x80, 0xff), N_("dull blue")},
-	{ GO_RGBA_TO_UINT (0x00, 0x00, 0xFF, 0xff), N_("blue")},
-	{ GO_RGBA_TO_UINT (0x66, 0x66, 0x99, 0xff), N_("dull purple")},
-	{ GO_RGBA_TO_UINT (0x80, 0x80, 0x80, 0xff), N_("dark gray")},
-
-	{ GO_RGBA_TO_UINT (0xFF, 0x00, 0x00, 0xff), N_("red")},
-	{ GO_RGBA_TO_UINT (0xFF, 0x99, 0x00, 0xff), N_("orange")},
-	{ GO_RGBA_TO_UINT (0x99, 0xCC, 0x00, 0xff), N_("lime")},
-	{ GO_RGBA_TO_UINT (0x33, 0x99, 0x66, 0xff), N_("dull green")},
-	{ GO_RGBA_TO_UINT (0x33, 0xCC, 0xCC, 0xff), N_("dull blue #2")},
-	{ GO_RGBA_TO_UINT (0x33, 0x66, 0xFF, 0xff), N_("sky blue #2")},
-	{ GO_RGBA_TO_UINT (0x80, 0x00, 0x80, 0xff), N_("purple")},
-	{ GO_RGBA_TO_UINT (0x96, 0x96, 0x96, 0xff), N_("gray")},
-
-	{ GO_RGBA_TO_UINT (0xFF, 0x00, 0xFF, 0xff), N_("magenta")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xCC, 0x00, 0xff), N_("bright orange")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xFF, 0x00, 0xff), N_("yellow")},
-	{ GO_RGBA_TO_UINT (0x00, 0xFF, 0x00, 0xff), N_("green")},
-	{ GO_RGBA_TO_UINT (0x00, 0xFF, 0xFF, 0xff), N_("cyan")},
-	{ GO_RGBA_TO_UINT (0x00, 0xCC, 0xFF, 0xff), N_("bright blue")},
-	{ GO_RGBA_TO_UINT (0x99, 0x33, 0x66, 0xff), N_("red purple")},
-	{ GO_RGBA_TO_UINT (0xC0, 0xC0, 0xC0, 0xff), N_("light gray")},
-
-	{ GO_RGBA_TO_UINT (0xFF, 0x99, 0xCC, 0xff), N_("pink")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xCC, 0x99, 0xff), N_("light orange")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xFF, 0x99, 0xff), N_("light yellow")},
-	{ GO_RGBA_TO_UINT (0xCC, 0xFF, 0xCC, 0xff), N_("light green")},
-	{ GO_RGBA_TO_UINT (0xCC, 0xFF, 0xFF, 0xff), N_("light cyan")},
-	{ GO_RGBA_TO_UINT (0x99, 0xCC, 0xFF, 0xff), N_("light blue")},
-	{ GO_RGBA_TO_UINT (0xCC, 0x99, 0xFF, 0xff), N_("light purple")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xFF, 0xFF, 0xff), N_("white")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x00, 0x00, 0xff), N_("black")},
+	{ GO_COLOR_FROM_RGBA (0x99, 0x33, 0x00, 0xff), N_("light brown")},
+	{ GO_COLOR_FROM_RGBA (0x33, 0x33, 0x00, 0xff), N_("brown gold")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x33, 0x00, 0xff), N_("dark green #2")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x33, 0x66, 0xff), N_("navy")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x00, 0x80, 0xff), N_("dark blue")},
+	{ GO_COLOR_FROM_RGBA (0x33, 0x33, 0x99, 0xff), N_("purple #2")},
+	{ GO_COLOR_FROM_RGBA (0x33, 0x33, 0x33, 0xff), N_("very dark gray")},
+
+	{ GO_COLOR_FROM_RGBA (0x80, 0x00, 0x00, 0xff), N_("dark red")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x66, 0x00, 0xff), N_("red-orange")},
+	{ GO_COLOR_FROM_RGBA (0x80, 0x80, 0x00, 0xff), N_("gold")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x80, 0x00, 0xff), N_("dark green")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x80, 0x80, 0xff), N_("dull blue")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x00, 0xFF, 0xff), N_("blue")},
+	{ GO_COLOR_FROM_RGBA (0x66, 0x66, 0x99, 0xff), N_("dull purple")},
+	{ GO_COLOR_FROM_RGBA (0x80, 0x80, 0x80, 0xff), N_("dark gray")},
+
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x00, 0x00, 0xff), N_("red")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x99, 0x00, 0xff), N_("orange")},
+	{ GO_COLOR_FROM_RGBA (0x99, 0xCC, 0x00, 0xff), N_("lime")},
+	{ GO_COLOR_FROM_RGBA (0x33, 0x99, 0x66, 0xff), N_("dull green")},
+	{ GO_COLOR_FROM_RGBA (0x33, 0xCC, 0xCC, 0xff), N_("dull blue #2")},
+	{ GO_COLOR_FROM_RGBA (0x33, 0x66, 0xFF, 0xff), N_("sky blue #2")},
+	{ GO_COLOR_FROM_RGBA (0x80, 0x00, 0x80, 0xff), N_("purple")},
+	{ GO_COLOR_FROM_RGBA (0x96, 0x96, 0x96, 0xff), N_("gray")},
+
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x00, 0xFF, 0xff), N_("magenta")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xCC, 0x00, 0xff), N_("bright orange")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xFF, 0x00, 0xff), N_("yellow")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0xFF, 0x00, 0xff), N_("green")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0xFF, 0xFF, 0xff), N_("cyan")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0xCC, 0xFF, 0xff), N_("bright blue")},
+	{ GO_COLOR_FROM_RGBA (0x99, 0x33, 0x66, 0xff), N_("red purple")},
+	{ GO_COLOR_FROM_RGBA (0xC0, 0xC0, 0xC0, 0xff), N_("light gray")},
+
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x99, 0xCC, 0xff), N_("pink")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xCC, 0x99, 0xff), N_("light orange")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xFF, 0x99, 0xff), N_("light yellow")},
+	{ GO_COLOR_FROM_RGBA (0xCC, 0xFF, 0xCC, 0xff), N_("light green")},
+	{ GO_COLOR_FROM_RGBA (0xCC, 0xFF, 0xFF, 0xff), N_("light cyan")},
+	{ GO_COLOR_FROM_RGBA (0x99, 0xCC, 0xFF, 0xff), N_("light blue")},
+	{ GO_COLOR_FROM_RGBA (0xCC, 0x99, 0xFF, 0xff), N_("light purple")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xFF, 0xFF, 0xff), N_("white")},
 
 	{ 0, NULL},
 
 	/* Disable these for now, they are mostly repeats */
-	{ GO_RGBA_TO_UINT (0x99, 0x99, 0xFF, 0xff), N_("purplish blue")},
-	{ GO_RGBA_TO_UINT (0x99, 0x33, 0x66, 0xff), N_("red purple")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xFF, 0xCC, 0xff), N_("light yellow")},
-	{ GO_RGBA_TO_UINT (0xCC, 0xFF, 0xFF, 0xff), N_("light blue")},
-	{ GO_RGBA_TO_UINT (0x66, 0x00, 0x66, 0xff), N_("dark purple")},
-	{ GO_RGBA_TO_UINT (0xFF, 0x80, 0x80, 0xff), N_("pink")},
-	{ GO_RGBA_TO_UINT (0x00, 0x66, 0xCC, 0xff), N_("sky blue")},
-	{ GO_RGBA_TO_UINT (0xCC, 0xCC, 0xFF, 0xff), N_("light purple")},
-
-	{ GO_RGBA_TO_UINT (0x00, 0x00, 0x80, 0xff), N_("dark blue")},
-	{ GO_RGBA_TO_UINT (0xFF, 0x00, 0xFF, 0xff), N_("magenta")},
-	{ GO_RGBA_TO_UINT (0xFF, 0xFF, 0x00, 0xff), N_("yellow")},
-	{ GO_RGBA_TO_UINT (0x00, 0xFF, 0xFF, 0xff), N_("cyan")},
-	{ GO_RGBA_TO_UINT (0x80, 0x00, 0x80, 0xff), N_("purple")},
-	{ GO_RGBA_TO_UINT (0x80, 0x00, 0x00, 0xff), N_("dark red")},
-	{ GO_RGBA_TO_UINT (0x00, 0x80, 0x80, 0xff), N_("dull blue")},
-	{ GO_RGBA_TO_UINT (0x00, 0x00, 0xFF, 0xff), N_("blue")},
+	{ GO_COLOR_FROM_RGBA (0x99, 0x99, 0xFF, 0xff), N_("purplish blue")},
+	{ GO_COLOR_FROM_RGBA (0x99, 0x33, 0x66, 0xff), N_("red purple")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xFF, 0xCC, 0xff), N_("light yellow")},
+	{ GO_COLOR_FROM_RGBA (0xCC, 0xFF, 0xFF, 0xff), N_("light blue")},
+	{ GO_COLOR_FROM_RGBA (0x66, 0x00, 0x66, 0xff), N_("dark purple")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x80, 0x80, 0xff), N_("pink")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x66, 0xCC, 0xff), N_("sky blue")},
+	{ GO_COLOR_FROM_RGBA (0xCC, 0xCC, 0xFF, 0xff), N_("light purple")},
+
+	{ GO_COLOR_FROM_RGBA (0x00, 0x00, 0x80, 0xff), N_("dark blue")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0x00, 0xFF, 0xff), N_("magenta")},
+	{ GO_COLOR_FROM_RGBA (0xFF, 0xFF, 0x00, 0xff), N_("yellow")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0xFF, 0xFF, 0xff), N_("cyan")},
+	{ GO_COLOR_FROM_RGBA (0x80, 0x00, 0x80, 0xff), N_("purple")},
+	{ GO_COLOR_FROM_RGBA (0x80, 0x00, 0x00, 0xff), N_("dark red")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x80, 0x80, 0xff), N_("dull blue")},
+	{ GO_COLOR_FROM_RGBA (0x00, 0x00, 0xFF, 0xff), N_("blue")},
 
 	{ 0, NULL},
 };
@@ -160,7 +160,7 @@ create_color_sel (GObject *action_proxy, GOColor c, GCallback handler, gboolean
 		go_color_to_gdk (c, &gdk));
 	gtk_color_selection_set_has_opacity_control (colorsel, allow_alpha);
 	if (allow_alpha)
-		gtk_color_selection_set_current_alpha (colorsel, GO_UINT_RGBA_A(c) * 257);
+		gtk_color_selection_set_current_alpha (colorsel, GO_COLOR_UINT_A(c) * 257);
 
 	g_signal_connect_object (dialog,
 		"response", handler, action_proxy, 0);
@@ -179,9 +179,9 @@ handle_color_sel (GtkColorSelectionDialog *dialog,
 		guint16 alpha = gtk_color_selection_get_current_alpha (colorsel);
 
 		gtk_color_selection_get_current_color (colorsel, &gdk);
-		*res = GO_GDK_TO_UINT (gdk);
+		*res = GO_COLOR_FROM_GDK (gdk);
 		alpha >>= 8;
-		*res = GO_UINT_RGBA_CHANGE_A (*res, alpha);
+		*res = GO_COLOR_CHANGE_A (*res, alpha);
 	}
 	/* destroy _before_ we emit */
 	gtk_object_destroy (GTK_OBJECT (dialog));
@@ -295,7 +295,7 @@ swatch_activated (GOColorPalette *pal, GtkBin *button)
 
 	g_return_if_fail (swatch != NULL);
 
-	set_color (pal, GO_GDK_TO_UINT (swatch->style->bg[GTK_STATE_NORMAL]),
+	set_color (pal, GO_COLOR_FROM_GDK (swatch->style->bg[GTK_STATE_NORMAL]),
 		   FALSE, TRUE, FALSE);
 }
 
diff --git a/goffice/gtk/go-color-selector.c b/goffice/gtk/go-color-selector.c
index 0f11e63..0564289 100644
--- a/goffice/gtk/go-color-selector.c
+++ b/goffice/gtk/go-color-selector.c
@@ -139,10 +139,10 @@ go_color_palette_render_func (cairo_t *cr,
 
 	cairo_set_line_width (cr, 1);
 	cairo_set_source_rgba (cr, 
-			       GO_DOUBLE_RGBA_R(color), 
-			       GO_DOUBLE_RGBA_G(color),
-			       GO_DOUBLE_RGBA_B(color),
-			       GO_DOUBLE_RGBA_A(color));
+			       GO_COLOR_DOUBLE_R(color), 
+			       GO_COLOR_DOUBLE_G(color),
+			       GO_COLOR_DOUBLE_B(color),
+			       GO_COLOR_DOUBLE_A(color));
 	cairo_rectangle (cr, area->x + .5 , area->y + .5 , area->width - 1, area->height - 1);
 	cairo_fill_preserve (cr);
 	cairo_set_source_rgb (cr, .75, .75, .75);
@@ -169,9 +169,9 @@ cb_color_dialog_response (GtkColorSelectionDialog *color_dialog,
 		alpha = gtk_color_selection_get_current_alpha (GTK_COLOR_SELECTION (color_selection));
 		state = go_selector_get_user_data (selector);
 		
-		color = GO_GDK_TO_UINT (gdk_color);
+		color = GO_COLOR_FROM_GDK (gdk_color);
 		alpha >>= 8;
-		color = GO_UINT_RGBA_CHANGE_A (color, alpha);
+		color = GO_COLOR_CHANGE_A (color, alpha);
 		if (!go_color_selector_set_color (selector, color))
 			/* Index is not necessarly changed, but swatch may change */
 			go_selector_activate (selector);
@@ -197,7 +197,7 @@ cb_combo_custom_activate (GOPalette *palette, GOSelector *selector)
 						       go_color_to_gdk (color, &gdk_color));
 		if (state->allow_alpha)
 			gtk_color_selection_set_current_alpha (GTK_COLOR_SELECTION (color_selection), 
-						       GO_UINT_RGBA_A (color) * 257);
+						       GO_COLOR_UINT_A (color) * 257);
 		gtk_window_present (GTK_WINDOW (color_dialog));
 		return;
 	}
@@ -212,7 +212,7 @@ cb_combo_custom_activate (GOPalette *palette, GOSelector *selector)
 					       go_color_to_gdk (color, &gdk_color));
 	if (state->allow_alpha)
 		gtk_color_selection_set_current_alpha (GTK_COLOR_SELECTION (color_selection), 
-					       GO_UINT_RGBA_A (color) * 257);
+					       GO_COLOR_UINT_A (color) * 257);
 	g_signal_connect (color_dialog, "response", G_CALLBACK (cb_color_dialog_response), selector);
        	gtk_widget_show (color_dialog);
 }
@@ -220,13 +220,13 @@ cb_combo_custom_activate (GOPalette *palette, GOSelector *selector)
 static void
 go_color_selector_drag_data_received (GOSelector *selector, gpointer data)
 {
-	GOColor color = GO_RGBA_WHITE;
+	GOColor color = GO_COLOR_WHITE;
 	guint16 *color_data = data;
 
-	color = GO_UINT_RGBA_CHANGE_R (color, color_data[0] >> 8);
-	color = GO_UINT_RGBA_CHANGE_G (color, color_data[1] >> 8);
-	color = GO_UINT_RGBA_CHANGE_B (color, color_data[2] >> 8);
-	color = GO_UINT_RGBA_CHANGE_A (color, color_data[3] >> 8);
+	color = GO_COLOR_CHANGE_R (color, color_data[0] >> 8);
+	color = GO_COLOR_CHANGE_G (color, color_data[1] >> 8);
+	color = GO_COLOR_CHANGE_B (color, color_data[2] >> 8);
+	color = GO_COLOR_CHANGE_A (color, color_data[3] >> 8);
 
 	go_color_selector_set_color (selector, color);
 }
@@ -245,10 +245,10 @@ go_color_selector_drag_data_get (GOSelector *selector)
 	index = go_selector_get_active (selector, NULL);
 	color = get_color (state->n_swatches, state->color_group, index);
 
-	data[0] = GO_UINT_RGBA_R (color) << 8;
-	data[1] = GO_UINT_RGBA_G (color) << 8;
-	data[2] = GO_UINT_RGBA_B (color) << 8;
-	data[3] = GO_UINT_RGBA_A (color) << 8; 
+	data[0] = GO_COLOR_UINT_R (color) << 8;
+	data[1] = GO_COLOR_UINT_G (color) << 8;
+	data[2] = GO_COLOR_UINT_B (color) << 8;
+	data[3] = GO_COLOR_UINT_A (color) << 8; 
 
 	return data;
 }
@@ -366,7 +366,7 @@ go_color_selector_get_color (GOSelector *selector, gboolean *is_auto)
 	int index;
 	gboolean flag;
 
-	g_return_val_if_fail (GO_IS_SELECTOR (selector), GO_RGB_WHITE);
+	g_return_val_if_fail (GO_IS_SELECTOR (selector), GO_COLOR_WHITE);
 	
 	index = go_selector_get_active (selector, &flag);
 	state = go_selector_get_user_data (selector);
diff --git a/goffice/gtk/go-combo-color.c b/goffice/gtk/go-combo-color.c
index 761586e..b5f0baa 100644
--- a/goffice/gtk/go-combo-color.c
+++ b/goffice/gtk/go-combo-color.c
@@ -97,8 +97,8 @@ go_combo_color_set_color_internal (GOComboColor *cc, GOColor color, gboolean is_
 				       width, color_height);
 
 	/* mostly transparent things should have an outline */
-	add_an_outline = (GO_UINT_RGBA_A (color) < 0x80);
-	gdk_pixbuf_fill (color_pixbuf, add_an_outline ? GO_RGBA_GREY (0x33) : color);
+	add_an_outline = (GO_COLOR_UINT_A (color) < 0x80);
+	gdk_pixbuf_fill (color_pixbuf, add_an_outline ? GO_COLOR_GREY (0x33) : color);
 	gdk_pixbuf_copy_area (color_pixbuf, 0, 0, width, color_height,
 		pixbuf, 0, color_y);
 	if (add_an_outline) {
@@ -244,7 +244,7 @@ color_table_setup (GOComboColor *cc,
 GOColor
 go_combo_color_get_color (GOComboColor *cc, gboolean *is_default)
 {
-	g_return_val_if_fail (GO_IS_COMBO_COLOR (cc), GO_RGBA_BLACK);
+	g_return_val_if_fail (GO_IS_COMBO_COLOR (cc), GO_COLOR_BLACK);
 	return go_color_palette_get_current_color (cc->palette, is_default, NULL);
 }
 
@@ -263,7 +263,7 @@ go_combo_color_set_color_gdk (GOComboColor *cc, GdkColor *color)
 	g_return_if_fail (GO_IS_COMBO_COLOR (cc));
 
 	if (color != NULL)
-		go_color_palette_set_current_color (cc->palette, GO_GDK_TO_UINT (*color));
+		go_color_palette_set_current_color (cc->palette, GO_COLOR_FROM_GDK (*color));
 	else
 		go_color_palette_set_color_to_default (cc->palette);
 }
diff --git a/goffice/gtk/go-gradient-selector.c b/goffice/gtk/go-gradient-selector.c
index 3bc950e..65b641f 100644
--- a/goffice/gtk/go-gradient-selector.c
+++ b/goffice/gtk/go-gradient-selector.c
@@ -93,8 +93,8 @@ go_gradient_selector_new (GOGradientDirection initial_direction,
 	GOGradientSelectorState *state;
 
 	state = g_new (GOGradientSelectorState, 1);
-	state->start_color = GO_RGBA_BLACK;
-	state->stop_color = GO_RGBA_WHITE;
+	state->start_color = GO_COLOR_BLACK;
+	state->stop_color = GO_COLOR_WHITE;
 
 	palette = go_palette_new (GO_GRADIENT_MAX, 1.0, 4, 
 				  go_gradient_swatch_render_func, NULL,
diff --git a/goffice/gtk/go-marker-selector.c b/goffice/gtk/go-marker-selector.c
index 4e82950..bd47ce2 100644
--- a/goffice/gtk/go-marker-selector.c
+++ b/goffice/gtk/go-marker-selector.c
@@ -75,8 +75,8 @@ go_marker_selector_new (GOMarkerShape initial_shape,
 	GOMarkerSelectorState *state;
 
 	state = g_new (GOMarkerSelectorState, 1);
-	state->outline_color = GO_RGBA_BLACK;
-	state->fill_color = GO_RGBA_WHITE;
+	state->outline_color = GO_COLOR_BLACK;
+	state->fill_color = GO_COLOR_WHITE;
 
 	palette = go_palette_new (GO_MARKER_MAX, 1.0, 4,
 				  go_marker_palette_render_func, NULL,
diff --git a/goffice/gtk/go-pattern-selector.c b/goffice/gtk/go-pattern-selector.c
index b403b8a..656c3b9 100644
--- a/goffice/gtk/go-pattern-selector.c
+++ b/goffice/gtk/go-pattern-selector.c
@@ -41,8 +41,8 @@ go_pattern_palette_render_func (cairo_t *cr,
 		pattern.fore = state->foreground;
 		pattern.back = state->background;
 	} else {
-		pattern.fore = GO_RGBA_BLACK;
-		pattern.back = GO_RGBA_WHITE;
+		pattern.fore = GO_COLOR_BLACK;
+		pattern.back = GO_COLOR_WHITE;
 	}
 	pattern.pattern = index;
 
@@ -76,8 +76,8 @@ go_pattern_selector_new (GOPatternType initial_type,
 	GOPatternSelectorState *state;
 
 	state = g_new (GOPatternSelectorState, 1);
-	state->foreground = GO_RGBA_WHITE;
-	state->background = GO_RGBA_BLACK;
+	state->foreground = GO_COLOR_WHITE;
+	state->background = GO_COLOR_BLACK;
 
 	palette = go_palette_new (GO_PATTERN_MAX, 1.0, 5,
 				  go_pattern_palette_render_func, NULL,
diff --git a/goffice/gtk/go-rotation-sel.c b/goffice/gtk/go-rotation-sel.c
index 88d0c62..e8aae47 100644
--- a/goffice/gtk/go-rotation-sel.c
+++ b/goffice/gtk/go-rotation-sel.c
@@ -64,7 +64,7 @@ cb_rotate_changed (GORotationSel *grs)
 	for (i = 0 ; i <= 12 ; i++)
 		if (grs->rotate_marks[i] != NULL) {
 			GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (grs->rotate_marks[i]));
-			colour = (grs->angle == (i-6)*15) ? GO_RGBA_GREEN : GO_RGBA_BLACK;
+			colour = (grs->angle == (i-6)*15) ? GO_COLOR_GREEN : GO_COLOR_BLACK;
 			if (style->fill.pattern.back != colour){
 				style->fill.pattern.back = colour;
 				goc_item_invalidate (grs->rotate_marks[i]);
@@ -121,14 +121,14 @@ cb_rotate_canvas_realize (GocCanvas *canvas, GORotationSel *grs)
 			NULL);
 		go_style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
 		go_style->line.width = 1.;
-		go_style->line.color = GO_RGBA_BLACK;
-		go_style->fill.pattern.back = GO_RGBA_BLACK;
+		go_style->line.color = GO_COLOR_BLACK;
+		go_style->fill.pattern.back = GO_COLOR_BLACK;
 		grs->rotate_marks[i] = item;
 	}
 	grs->line = goc_item_new (group, GOC_TYPE_LINE, NULL);
 	go_style = go_styled_object_get_style (GO_STYLED_OBJECT (grs->line));
 	go_style->line.width = 2.;
-	go_style->line.color = GO_RGBA_BLACK;
+	go_style->line.color = GO_COLOR_BLACK;
 
 	{
 		int w, h;
diff --git a/goffice/utils/go-color.c b/goffice/utils/go-color.c
index 184f80c..b1395db 100644
--- a/goffice/utils/go-color.c
+++ b/goffice/utils/go-color.c
@@ -38,7 +38,7 @@ go_color_from_str (gchar const *str, GOColor *res)
 	unsigned r, g, b, a;
 
 	if (sscanf (str, "%X:%X:%X:%X", &r, &g, &b, &a) == 4) {
-		*res = GO_RGBA_TO_UINT (r, g, b, a);
+		*res = GO_COLOR_FROM_RGBA (r, g, b, a);
 		return TRUE;
 	}
 	return FALSE;
@@ -49,7 +49,7 @@ go_color_as_str (GOColor color)
 {
 	unsigned r, g, b, a;
 
-	GO_UINT_TO_RGBA (color, &r, &g, &b, &a);
+	GO_COLOR_TO_RGBA (color, &r, &g, &b, &a);
 	return g_strdup_printf ("%X:%X:%X:%X", r, g, b, a);
 }
 
@@ -57,11 +57,11 @@ PangoAttribute *
 go_color_to_pango (GOColor color, gboolean is_fore)
 {
 	guint16 r, g, b;
-	r  = GO_UINT_RGBA_R (color);
+	r  = GO_COLOR_UINT_R (color);
 	r |= (r << 8);
-	g  = GO_UINT_RGBA_G (color);
+	g  = GO_COLOR_UINT_G (color);
 	g |= (g << 8);
-	b  = GO_UINT_RGBA_B (color);
+	b  = GO_COLOR_UINT_B (color);
 	b |= (b << 8);
 
 	if (is_fore)
@@ -76,11 +76,11 @@ go_color_to_pango (GOColor color, gboolean is_fore)
 GdkColor *
 go_color_to_gdk	(GOColor color, GdkColor *res)
 {
-	res->red    = GO_UINT_RGBA_R (color);
+	res->red    = GO_COLOR_UINT_R (color);
 	res->red   |= (res->red << 8);
-	res->green  = GO_UINT_RGBA_G (color);
+	res->green  = GO_COLOR_UINT_G (color);
 	res->green |= (res->green << 8);
-	res->blue   = GO_UINT_RGBA_B (color);
+	res->blue   = GO_COLOR_UINT_B (color);
 	res->blue  |= (res->blue << 8);
 
 	return res;
diff --git a/goffice/utils/go-color.h b/goffice/utils/go-color.h
index 1059b59..ce967b2 100644
--- a/goffice/utils/go-color.h
+++ b/goffice/utils/go-color.h
@@ -45,56 +45,45 @@ typedef struct {
   cpp-perils...
 */
 
-#define GO_GDK_TO_UINT(c)	GO_RGBA_TO_UINT(((c).red>>8), ((c).green>>8), ((c).blue>>8), 0xff)
+#define GO_COLOR_FROM_GDK(c)	GO_COLOR_FROM_RGBA(((c).red>>8), ((c).green>>8), ((c).blue>>8), 0xff)
 
-#define GO_RGB_TO_UINT(r,g,b)	((((guint)(r))<<16)|(((guint)(g))<<8)|((guint)(b)))
-#define GO_RGB_TO_RGBA(x,a)	(((x) << 8) | ((((guint)a) & 0xff)))
-#define GO_RGB_WHITE  GO_RGB_TO_UINT(0xff, 0xff, 0xff)
-#define GO_RGB_BLACK   GO_RGB_TO_UINT(0x00, 0x00, 0x00)
-#define GO_RGB_RED     GO_RGB_TO_UINT(0xff, 0x00, 0x00)
-#define GO_RGB_GREEN   GO_RGB_TO_UINT(0x00, 0xff, 0x00)
-#define GO_RGB_BLUE   GO_RGB_TO_UINT(0x00, 0x00, 0xff)
-#define GO_RGB_YELLOW  GO_RGB_TO_UINT(0xff, 0xff, 0x00)
-#define GO_RGB_VIOLET  GO_RGB_TO_UINT(0xff, 0x00, 0xff)
-#define GO_RGB_CYAN    GO_RGB_TO_UINT(0x00, 0xff, 0xff)
-#define GO_RGB_GREY(x) GO_RGB_TO_UINT(x,x,x)
+#define GO_COLOR_FROM_RGB(r,g,b)	((((guint)(r&0xff))<<24)|(((guint)(g&0xff))<<16)|((guint)(b&0xff)<<8)|0xff)
+#define GO_COLOR_FROM_RGBA(r,g,b,a)	((((guint)(r&0xff))<<24)|(((guint)(g&0xff))<<16)|((guint)(b&0xff)<<8)|(guint)(a&0xff))
+#define GO_COLOR_WHITE  GO_COLOR_FROM_RGB(0xff, 0xff, 0xff)
+#define GO_COLOR_BLACK   GO_COLOR_FROM_RGB(0x00, 0x00, 0x00)
+#define GO_COLOR_RED     GO_COLOR_FROM_RGB(0xff, 0x00, 0x00)
+#define GO_COLOR_GREEN   GO_COLOR_FROM_RGB(0x00, 0xff, 0x00)
+#define GO_COLOR_BLUE   GO_COLOR_FROM_RGB(0x00, 0x00, 0xff)
+#define GO_COLOR_YELLOW  GO_COLOR_FROM_RGB(0xff, 0xff, 0x00)
+#define GO_COLOR_VIOLET  GO_COLOR_FROM_RGB(0xff, 0x00, 0xff)
+#define GO_COLOR_CYAN    GO_COLOR_FROM_RGB(0x00, 0xff, 0xff)
+#define GO_COLOR_GREY(x) GO_COLOR_FROM_RGB(x,x,x)
 
-#define GO_RGBA_TO_UINT(r,g,b,a)	((((guint)(r))<<24)|(((guint)(g))<<16)|(((guint)(b))<<8)|(guint)(a))
-#define GO_RGBA_WHITE  GO_RGB_TO_RGBA(GO_RGB_WHITE, 0xff)
-#define GO_RGBA_BLACK GO_RGB_TO_RGBA(GO_RGB_BLACK, 0xff)
-#define GO_RGBA_RED    GO_RGB_TO_RGBA(GO_RGB_RED, 0xff)
-#define GO_RGBA_GREEN  GO_RGB_TO_RGBA(GO_RGB_GREEN, 0xff)
-#define GO_RGBA_BLUE   GO_RGB_TO_RGBA(GO_RGB_BLUE, 0xff)
-#define GO_RGBA_YELLOW GO_RGB_TO_RGBA(GO_RGB_YELLOW, 0xff)
-#define GO_RGBA_VIOLET GO_RGB_TO_RGBA(GO_RGB_VIOLET, 0xff)
-#define GO_RGBA_CYAN   GO_RGB_TO_RGBA(GO_RGB_CYAN, 0xff)
-#define GO_RGBA_GREY(x) GO_RGB_TO_RGBA(GO_RGB_GREY(x), 0xff)
+#define GO_COLOR_UINT_R(x) (((guint)(x))>>24)
+#define GO_COLOR_UINT_G(x) ((((guint)(x))>>16)&0xff)
+#define GO_COLOR_UINT_B(x) ((((guint)(x))>>8)&0xff)
+#define GO_COLOR_UINT_A(x) (((guint)(x))&0xff)
+#define GO_COLOR_CHANGE_R(x, r) (((x)&(~(0xff<<24)))|(((r)&0xff)<<24))
+#define GO_COLOR_CHANGE_G(x, g) (((x)&(~(0xff<<16)))|(((g)&0xff)<<16))
+#define GO_COLOR_CHANGE_B(x, b) (((x)&(~(0xff<<8)))|(((b)&0xff)<<8))
+#define GO_COLOR_CHANGE_A(x, a) (((x)&(~0xff))|((a)&0xff))
+#define GO_COLOR_TO_RGB(u,r,g,b) \
+{ (*(r)) = ((u)>>24)&0xff; (*(g)) = ((u)>>16)&0xff; (*(b)) = ((u)>>8)&0xff; }
+#define GO_COLOR_TO_RGBA(u,r,g,b,a) \
+{GO_COLOR_TO_RGB((u),r,g,b); (*(a)) = (u)&0xff; }
+#define GO_COLOR_MONO_INTERPOLATE(v1, v2, t) ((gint)go_rint((v2)*(t)+(v1)*(1-(t))))
+#define GO_COLOR_INTERPOLATE(c1, c2, t) \
+  GO_COLOR_FROM_RGBA( GO_COLOR_MONO_INTERPOLATE(GO_COLOR_UINT_R(c1), GO_COLOR_UINT_R(c2), t), \
+		GO_COLOR_MONO_INTERPOLATE(GO_COLOR_UINT_G(c1), GO_COLOR_UINT_G(c2), t), \
+		GO_COLOR_MONO_INTERPOLATE(GO_COLOR_UINT_B(c1), GO_COLOR_UINT_B(c2), t), \
+		GO_COLOR_MONO_INTERPOLATE(GO_COLOR_UINT_A(c1), GO_COLOR_UINT_A(c2), t) )
 
-#define GO_UINT_RGBA_R(x) (((guint)(x))>>24)
-#define GO_UINT_RGBA_G(x) ((((guint)(x))>>16)&0xff)
-#define GO_UINT_RGBA_B(x) ((((guint)(x))>>8)&0xff)
-#define GO_UINT_RGBA_A(x) (((guint)(x))&0xff)
-#define GO_UINT_RGBA_CHANGE_R(x, r) (((x)&(~(0xff<<24)))|(((r)&0xff)<<24))
-#define GO_UINT_RGBA_CHANGE_G(x, g) (((x)&(~(0xff<<16)))|(((g)&0xff)<<16))
-#define GO_UINT_RGBA_CHANGE_B(x, b) (((x)&(~(0xff<<8)))|(((b)&0xff)<<8))
-#define GO_UINT_RGBA_CHANGE_A(x, a) (((x)&(~0xff))|((a)&0xff))
-#define GO_UINT_TO_RGB(u,r,g,b) \
-{ (*(r)) = ((u)>>16)&0xff; (*(g)) = ((u)>>8)&0xff; (*(b)) = (u)&0xff; }
-#define GO_UINT_TO_RGBA(u,r,g,b,a) \
-{GO_UINT_TO_RGB(((u)>>8),r,g,b); (*(a)) = (u)&0xff; }
-#define GO_MONO_INTERPOLATE(v1, v2, t) ((gint)go_rint((v2)*(t)+(v1)*(1-(t))))
-#define GO_UINT_INTERPOLATE(c1, c2, t) \
-  GO_RGBA_TO_UINT( GO_MONO_INTERPOLATE(GO_UINT_RGBA_R(c1), GO_UINT_RGBA_R(c2), t), \
-		GO_MONO_INTERPOLATE(GO_UINT_RGBA_G(c1), GO_UINT_RGBA_G(c2), t), \
-		GO_MONO_INTERPOLATE(GO_UINT_RGBA_B(c1), GO_UINT_RGBA_B(c2), t), \
-		GO_MONO_INTERPOLATE(GO_UINT_RGBA_A(c1), GO_UINT_RGBA_A(c2), t) )
+#define GO_COLOR_DOUBLE_R(x) (double)GO_COLOR_UINT_R(x)/255.0
+#define GO_COLOR_DOUBLE_G(x) (double)GO_COLOR_UINT_G(x)/255.0
+#define GO_COLOR_DOUBLE_B(x) (double)GO_COLOR_UINT_B(x)/255.0
+#define GO_COLOR_DOUBLE_A(x) (double)GO_COLOR_UINT_A(x)/255.0
 
-#define GO_DOUBLE_RGBA_R(x) (double)GO_UINT_RGBA_R(x)/255.0
-#define GO_DOUBLE_RGBA_G(x) (double)GO_UINT_RGBA_G(x)/255.0
-#define GO_DOUBLE_RGBA_B(x) (double)GO_UINT_RGBA_B(x)/255.0
-#define GO_DOUBLE_RGBA_A(x) (double)GO_UINT_RGBA_A(x)/255.0
-
-#define GO_COLOR_TO_CAIRO(x) GO_DOUBLE_RGBA_R(x),GO_DOUBLE_RGBA_G(x),GO_DOUBLE_RGBA_B(x),GO_DOUBLE_RGBA_A(x)
+#define GO_COLOR_TO_CAIRO(x) GO_COLOR_DOUBLE_R(x),GO_COLOR_DOUBLE_G(x),GO_COLOR_DOUBLE_B(x),GO_COLOR_DOUBLE_A(x)
 
 gboolean  go_color_from_str (char const *str, GOColor *res);
 gchar    *go_color_as_str   (GOColor color);
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index b471bca..c4563ba 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -538,14 +538,14 @@ static struct {
 	char const *name;
 	GOColor	go_color;
 } const format_colors[] = {
-	{ N_("Black"),	 GO_RGBA_BLACK },
-	{ N_("Blue"),	 GO_RGBA_BLUE },
-	{ N_("Cyan"),	 GO_RGBA_CYAN },
-	{ N_("Green"),	 GO_RGBA_GREEN },
-	{ N_("Magenta"), GO_RGBA_VIOLET },
-	{ N_("Red"),	 GO_RGBA_RED },
-	{ N_("White"),	 GO_RGBA_WHITE },
-	{ N_("Yellow"),	 GO_RGBA_YELLOW }
+	{ N_("Black"),	 GO_COLOR_BLACK },
+	{ N_("Blue"),	 GO_COLOR_BLUE },
+	{ N_("Cyan"),	 GO_COLOR_CYAN },
+	{ N_("Green"),	 GO_COLOR_GREEN },
+	{ N_("Magenta"), GO_COLOR_VIOLET },
+	{ N_("Red"),	 GO_COLOR_RED },
+	{ N_("White"),	 GO_COLOR_WHITE },
+	{ N_("Yellow"),	 GO_COLOR_YELLOW }
 };
 
 /*
@@ -5869,8 +5869,8 @@ go_format_output_date_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 				ODF_CLOSE_STRING;
 				gsf_xml_out_start_element (xout, STYLE "text-properties");
 				str = g_strdup_printf ("#%.2X%.2X%.2X", 
-						       GO_UINT_RGBA_R (color), GO_UINT_RGBA_G (color), 
-						       GO_UINT_RGBA_B (color));
+						       GO_COLOR_UINT_R (color), GO_COLOR_UINT_G (color), 
+						       GO_COLOR_UINT_B (color));
 				gsf_xml_out_add_cstr_unchecked (xout, FOSTYLE "color", str);
 				g_free (str);
 				gsf_xml_out_end_element (xout); /*<style:text-properties>*/
@@ -6033,8 +6033,8 @@ go_format_output_fraction_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 				ODF_CLOSE_STRING;
 				gsf_xml_out_start_element (xout, STYLE "text-properties");
 				str = g_strdup_printf ("#%.2X%.2X%.2X", 
-						       GO_UINT_RGBA_R (color), GO_UINT_RGBA_G (color), 
-						       GO_UINT_RGBA_B (color));
+						       GO_COLOR_UINT_R (color), GO_COLOR_UINT_G (color), 
+						       GO_COLOR_UINT_B (color));
 				gsf_xml_out_add_cstr_unchecked (xout, FOSTYLE "color", str);
 				g_free (str);
 				gsf_xml_out_end_element (xout); /*<style:text-properties>*/
@@ -6235,8 +6235,8 @@ go_format_output_number_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 				ODF_WRITE_NUMBER;
 				gsf_xml_out_start_element (xout, STYLE "text-properties");
 				str = g_strdup_printf ("#%.2X%.2X%.2X", 
-						       GO_UINT_RGBA_R (color), GO_UINT_RGBA_G (color), 
-						       GO_UINT_RGBA_B (color));
+						       GO_COLOR_UINT_R (color), GO_COLOR_UINT_G (color), 
+						       GO_COLOR_UINT_B (color));
 				gsf_xml_out_add_cstr_unchecked (xout, FOSTYLE "color", str);
 				g_free (str);
 				gsf_xml_out_end_element (xout); /*<style:text-properties>*/
@@ -6482,8 +6482,8 @@ go_format_output_scientific_number_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 				ODF_CLOSE_STRING;
 				gsf_xml_out_start_element (xout, STYLE "text-properties");
 				str = g_strdup_printf ("#%.2X%.2X%.2X", 
-						       GO_UINT_RGBA_R (color), GO_UINT_RGBA_G (color), 
-						       GO_UINT_RGBA_B (color));
+						       GO_COLOR_UINT_R (color), GO_COLOR_UINT_G (color), 
+						       GO_COLOR_UINT_B (color));
 				gsf_xml_out_add_cstr_unchecked (xout, FOSTYLE "color", str);
 				g_free (str);
 				gsf_xml_out_end_element (xout); /*<style:text-properties>*/
diff --git a/goffice/utils/go-image.c b/goffice/utils/go-image.c
index 426f0c8..187d1a7 100644
--- a/goffice/utils/go-image.c
+++ b/goffice/utils/go-image.c
@@ -635,8 +635,8 @@ go_image_fill (GOImage *image, GOColor color)
 
 	dst = image->data;
 	if (image->target_cairo)
-		val = (GO_UINT_RGBA_R (color) << 8) + (GO_UINT_RGBA_G (color) << 16)
-			+ (GO_UINT_RGBA_B (color) << 24) + GO_UINT_RGBA_A (color);
+		val = (GO_COLOR_UINT_R (color) << 8) + (GO_COLOR_UINT_G (color) << 16)
+			+ (GO_COLOR_UINT_B (color) << 24) + GO_COLOR_UINT_A (color);
 	else
 		val = color;
 	for (i = 0; i < image->height; i++) {
diff --git a/goffice/utils/go-libxml-extras.c b/goffice/utils/go-libxml-extras.c
index ee0ba0f..d881b71 100644
--- a/goffice/utils/go-libxml-extras.c
+++ b/goffice/utils/go-libxml-extras.c
@@ -169,7 +169,7 @@ go_xml_node_get_gocolor (xmlNodePtr node, char const *name, GOColor *res)
 		r >>= 8;
 		g >>= 8;
 		b >>= 8;
-		*res = GO_RGBA_TO_UINT (r,g,b,0xff);
+		*res = GO_COLOR_FROM_RGBA (r,g,b,0xff);
 		xmlFree (color);
 		return TRUE;
 	}
@@ -183,7 +183,7 @@ go_xml_node_set_gocolor (xmlNodePtr node, char const *name, GOColor val)
 	unsigned r, g, b;
 	char str[4 * sizeof (val)];
 
-	GO_UINT_TO_RGB (val, &r, &g, &b);
+	GO_COLOR_TO_RGB (val, &r, &g, &b);
 	sprintf (str, "%X:%X:%X", r, g, b);
 	go_xml_node_set_cstr (node, name, str);
 }
diff --git a/goffice/utils/go-marker.c b/goffice/utils/go-marker.c
index 316cc38..ee50f27 100644
--- a/goffice/utils/go-marker.c
+++ b/goffice/utils/go-marker.c
@@ -96,8 +96,8 @@ static void
 go_marker_init (GOMarker * marker)
 {
 	marker->shape		= GO_MARKER_NONE;
-	marker->outline_color	= GO_RGBA_BLACK;
-	marker->fill_color	= GO_RGBA_WHITE;
+	marker->outline_color	= GO_COLOR_BLACK;
+	marker->fill_color	= GO_COLOR_WHITE;
 	marker->size		= MARKER_DEFAULT_SIZE;
 }
 
diff --git a/goffice/utils/go-pattern.c b/goffice/utils/go-pattern.c
index 9199337..3876b16 100644
--- a/goffice/utils/go-pattern.c
+++ b/goffice/utils/go-pattern.c
@@ -126,7 +126,7 @@ go_pattern_set_solid (GOPattern *pat, GOColor fore)
 {
 	g_return_if_fail (pat != NULL);
 	pat->pattern = GO_PATTERN_SOLID;
-	pat->fore = GO_RGBA_BLACK;
+	pat->fore = GO_COLOR_BLACK;
 	pat->back = fore;
 }
 
@@ -270,10 +270,10 @@ go_pattern_create_cairo_pattern (GOPattern const *pattern, cairo_t *cr)
 			for (i = 0; i < 8; i++) {
 				for (j = 0; j < 8; j++) {
 					color = pattern_data[i] & (1 << j) ? pattern->fore : pattern->back;
-					iter[3] = GO_UINT_RGBA_A (color);
-					MULT (iter[0], GO_UINT_RGBA_B (color), iter[3], t);
-					MULT (iter[1], GO_UINT_RGBA_G (color), iter[3], t);
-					MULT (iter[2], GO_UINT_RGBA_R (color), iter[3], t);
+					iter[3] = GO_COLOR_UINT_A (color);
+					MULT (iter[0], GO_COLOR_UINT_B (color), iter[3], t);
+					MULT (iter[1], GO_COLOR_UINT_G (color), iter[3], t);
+					MULT (iter[2], GO_COLOR_UINT_R (color), iter[3], t);
 					iter += 4;
 				}
 				iter += stride - 32;
diff --git a/goffice/utils/go-style.c b/goffice/utils/go-style.c
index ba92707..88c7647 100644
--- a/goffice/utils/go-style.c
+++ b/goffice/utils/go-style.c
@@ -749,7 +749,7 @@ marker_init (StylePrefState *state, gboolean enable, GOEditor *editor, GOCmdCont
 					       go_marker_get_fill_color (style->marker.mark));
 	else
 		go_marker_selector_set_colors (GO_SELECTOR (selector), 
-					       GO_RGBA_BLUE, GO_RGBA_BLUE);
+					       GO_COLOR_BLUE, GO_COLOR_BLUE);
 	w = go_gtk_builder_get_widget (gui, "marker_shape_label");
 	gtk_label_set_mnemonic_widget (GTK_LABEL (w), selector);
 	gtk_table_attach (GTK_TABLE (table), selector, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
@@ -765,7 +765,7 @@ marker_init (StylePrefState *state, gboolean enable, GOEditor *editor, GOCmdCont
 			G_CALLBACK (cb_marker_fill_color_changed));
 	else {
 		w = create_go_combo_color (state,
-			GO_RGBA_BLUE, GO_RGBA_BLUE,
+			GO_COLOR_BLUE, GO_COLOR_BLUE,
 			gui, "pattern_background", "marker_fill_label",
 			G_CALLBACK (cb_marker_fill_color_changed));
 		gtk_widget_set_sensitive (w, FALSE);
@@ -780,7 +780,7 @@ marker_init (StylePrefState *state, gboolean enable, GOEditor *editor, GOCmdCont
 			G_CALLBACK (cb_marker_outline_color_changed));
 	else {
 		w = create_go_combo_color (state,
-			GO_RGBA_BLUE, GO_RGBA_BLUE,
+			GO_COLOR_BLUE, GO_COLOR_BLUE,
 			gui, "pattern_background", "marker_fill_label",
 			G_CALLBACK (cb_marker_outline_color_changed));
 		gtk_widget_set_sensitive (w, FALSE);
@@ -1184,9 +1184,9 @@ go_style_init (GOStyle *style)
 	style->line.miter_limit = 10.;
 	style->fill.type = GO_STYLE_FILL_NONE;
 	style->fill.gradient.brightness = -1.;
-	go_pattern_set_solid (&style->fill.pattern, GO_RGBA_BLACK);
+	go_pattern_set_solid (&style->fill.pattern, GO_COLOR_BLACK);
 	style->font.font = go_font_new_by_index (0);
-	style->font.color = GO_RGBA_BLACK;
+	style->font.color = GO_COLOR_BLACK;
 	style->text_layout.angle = 0.0;
 }
 
@@ -1893,7 +1893,7 @@ go_style_is_outline_visible (GOStyle const *style)
 	g_return_val_if_fail (GO_IS_STYLE (style), FALSE);
 
 	/* FIXME FIXME FIXME make this smarter */
-	return GO_UINT_RGBA_A (style->line.color) > 0 && 
+	return GO_COLOR_UINT_A (style->line.color) > 0 && 
 		style->line.dash_type != GO_LINE_NONE;
 }
 
@@ -1903,7 +1903,7 @@ go_style_is_line_visible (GOStyle const *style)
 	g_return_val_if_fail (GO_IS_STYLE (style), FALSE);
 
 	/* FIXME FIXME FIXME TODO : make this smarter */
-	return GO_UINT_RGBA_A (style->line.color) > 0 && 
+	return GO_COLOR_UINT_A (style->line.color) > 0 && 
 		style->line.dash_type != GO_LINE_NONE;
 }
 
@@ -2006,8 +2006,8 @@ go_style_set_fill_brightness (GOStyle *style, float brightness)
 
 	style->fill.gradient.brightness = brightness;
 	style->fill.pattern.fore = (brightness < 50.)
-		? GO_UINT_INTERPOLATE(style->fill.pattern.back, GO_RGBA_WHITE, 1. - brightness / 50.)
-		: GO_UINT_INTERPOLATE(style->fill.pattern.back, GO_RGBA_BLACK, brightness / 50. - 1.);
+		? GO_COLOR_INTERPOLATE(style->fill.pattern.back, GO_COLOR_WHITE, 1. - brightness / 50.)
+		: GO_COLOR_INTERPOLATE(style->fill.pattern.back, GO_COLOR_BLACK, brightness / 50. - 1.);
 }
 
 /**
diff --git a/plugins/plot_radar/gog-radar.c b/plugins/plot_radar/gog-radar.c
index 70358a9..a43bc3d 100644
--- a/plugins/plot_radar/gog-radar.c
+++ b/plugins/plot_radar/gog-radar.c
@@ -643,16 +643,16 @@ get_map_color (double z, gboolean hide_outliers)
 	if (hide_outliers && (z < 0. || z > 6.))
 		return 0;
 	if (z <= 0.)
-		return GO_RGBA_BLUE;
+		return GO_COLOR_BLUE;
 	if (z <= 1.)
-		return GO_RGBA_BLUE + ((int) (z * 255.) << 16);
+		return GO_COLOR_BLUE + ((int) (z * 255.) << 16);
 	if (z <= 2.)
-		return GO_RGBA_GREEN + ((int) ((2. - z) * 255) << 8);
+		return GO_COLOR_GREEN + ((int) ((2. - z) * 255) << 8);
 	if (z <= 4.)
-		return GO_RGBA_GREEN + ((int) ((z / 2. - 1.) * 255) << 24);
+		return GO_COLOR_GREEN + ((int) ((z / 2. - 1.) * 255) << 24);
 	if (z <= 6.)
-		return GO_RGBA_RED + ((int) ((3. - z / 2.) * 255) << 16);
-	return GO_RGBA_RED;
+		return GO_COLOR_RED + ((int) ((3. - z / 2.) * 255) << 16);
+	return GO_COLOR_RED;
 }
 
 static void
diff --git a/plugins/plot_surface/gog-contour.c b/plugins/plot_surface/gog-contour.c
index 97924fd..b801a47 100644
--- a/plugins/plot_surface/gog-contour.c
+++ b/plugins/plot_surface/gog-contour.c
@@ -156,7 +156,7 @@ gog_contour_plot_foreach_elem  (GogPlot *plot, gboolean only_visible,
 	/* build the colors table */
 	color = g_new0 (GOColor, (j > 0)? j: 1);
 	if (j < 2)
-		color[0] = GO_RGBA_WHITE;
+		color[0] = GO_COLOR_WHITE;
 	else for (i = 0; i < j; i++) {
 		gog_theme_fillin_style (theme, style, GOG_OBJECT (plot->series->data), i, style->interesting_fields);
 		color[i] = style->fill.pattern.back;
@@ -332,7 +332,7 @@ gog_contour_view_render (GogView *view, GogViewAllocation const *bbox)
 	/* build the colors table */
 	color = g_new0 (GOColor, max);
 	if (max < 2)
-		color[0] = GO_RGBA_WHITE;
+		color[0] = GO_COLOR_WHITE;
 	else for (i = 0; i < (unsigned) max; i++) {
 		gog_theme_fillin_style (theme, style, GOG_OBJECT (series), i, style->interesting_fields);
 		color[i] = style->fill.pattern.back;
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index 550d462..53e9b75 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -840,16 +840,16 @@ get_map_color (double z, gboolean hide_outliers)
 	if (hide_outliers && (z < 0. || z > 6.))
 		return 0;
 	if (z <= 0.)
-		return GO_RGBA_BLUE;
+		return GO_COLOR_BLUE;
 	if (z <= 1.)
-		return GO_RGBA_BLUE + ((int) (z * 255.) << 16);
+		return GO_COLOR_BLUE + ((int) (z * 255.) << 16);
 	if (z <= 2.)
-		return GO_RGBA_GREEN + ((int) ((2. - z) * 255) << 8);
+		return GO_COLOR_GREEN + ((int) ((2. - z) * 255) << 8);
 	if (z <= 4.)
-		return GO_RGBA_GREEN + ((int) ((z / 2. - 1.) * 255) << 24);
+		return GO_COLOR_GREEN + ((int) ((z / 2. - 1.) * 255) << 24);
 	if (z <= 6.)
-		return GO_RGBA_RED + ((int) ((3. - z / 2.) * 255) << 16);
-	return GO_RGBA_RED;
+		return GO_COLOR_RED + ((int) ((3. - z / 2.) * 255) << 16);
+	return GO_COLOR_RED;
 }
 
 typedef struct {
@@ -1118,7 +1118,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
 				neg_style = go_style_dup (GOG_STYLED_OBJECT (series)->style);
 				neg_style->fill.type = GO_STYLE_FILL_PATTERN;
 				neg_style->fill.pattern.pattern = GO_PATTERN_SOLID;
-				neg_style->fill.pattern.back = GO_RGBA_WHITE;
+				neg_style->fill.pattern.back = GO_COLOR_WHITE;
 			}
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]