From 271145645cea0898eb461b36b631f9ee0c43887d Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 6 Nov 2010 12:38:52 +0100 Subject: [PATCH] GtkThemingEngine: Use GtkSymbolicColor for shades. --- gtk/gtkthemingengine.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index 968656fab1..583e87e162 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -1235,10 +1235,14 @@ color_shade (const GdkRGBA *color, gdouble factor, GdkRGBA *color_return) { - color_return->red = CLAMP (color->red * factor, 0, 1); - color_return->green = CLAMP (color->green * factor, 0, 1); - color_return->blue = CLAMP (color->blue * factor, 0, 1); - color_return->alpha = color->alpha; + GtkSymbolicColor *literal, *shade; + + literal = gtk_symbolic_color_new_literal (color); + shade = gtk_symbolic_color_new_shade (literal, factor); + gtk_symbolic_color_unref (literal); + + gtk_symbolic_color_resolve (shade, NULL, color_return); + gtk_symbolic_color_unref (shade); } static void