]> Pileus Git - ~andy/gtk/commitdiff
cssvalue: Make shade() work properly again
authorBenjamin Otte <otte@redhat.com>
Fri, 9 Nov 2012 19:30:48 +0000 (20:30 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 10 Nov 2012 13:25:18 +0000 (14:25 +0100)
In a previous commit, I accidentally scaled the hue instead of the
saturation. Ooops.

gtk/gtkcsscolorvalue.c
gtk/gtksymboliccolor.c

index 6268262588e3c4498e230209af0326c313efba3d..0dfbfde85172e15f940e264dde69dc3708dd8095 100644 (file)
@@ -189,8 +189,8 @@ gtk_css_color_value_resolve_full (GtkCssValue             *color,
         hsla.lightness *= color->sym_col.shade.factor;
         hsla.lightness = CLAMP (hsla.lightness, 0.0, 1.0);
 
-        hsla.hue *= color->sym_col.shade.factor;
-        hsla.hue = CLAMP (hsla.hue, 0.0, 1.0);
+        hsla.saturation *= color->sym_col.shade.factor;
+        hsla.saturation = CLAMP (hsla.saturation, 0.0, 1.0);
 
         _gdk_rgba_init_from_hsla (&shade, &hsla);
 
index 2e30e09cac08bd78fe0f3f1890322f72f1317c0b..87985e0e06c69e9717cdd24fb9a9d0cc381a10d1 100644 (file)
@@ -521,8 +521,8 @@ _shade_color (GdkRGBA *color,
   hsla.lightness *= factor;
   hsla.lightness = CLAMP (hsla.lightness, 0.0, 1.0);
 
-  hsla.hue *= factor;
-  hsla.hue = CLAMP (hsla.hue, 0.0, 1.0);
+  hsla.saturation *= factor;
+  hsla.saturation = CLAMP (hsla.saturation, 0.0, 1.0);
 
   _gdk_rgba_init_from_hsla (color, &hsla);
 }