[gtk+] cssvalue: Make shade() work properly again



commit aae2bf91cb0b092529fea7efe1d9884f9168e5aa
Author: Benjamin Otte <otte redhat com>
Date:   Fri Nov 9 20:30:48 2012 +0100

    cssvalue: Make shade() work properly again
    
    In a previous commit, I accidentally scaled the hue instead of the
    saturation. Ooops.

 gtk/gtkcsscolorvalue.c |    4 ++--
 gtk/gtksymboliccolor.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c
index 6268262..0dfbfde 100644
--- a/gtk/gtkcsscolorvalue.c
+++ b/gtk/gtkcsscolorvalue.c
@@ -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);
 
diff --git a/gtk/gtksymboliccolor.c b/gtk/gtksymboliccolor.c
index 2e30e09..87985e0 100644
--- a/gtk/gtksymboliccolor.c
+++ b/gtk/gtksymboliccolor.c
@@ -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);
 }



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