]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkhsla.c
GtkEntry: Sanity check the end_pos value in _get_display_text()
[~andy/gtk] / gtk / gtkhsla.c
index a78849789d1ea78f40a447305eb177a067ba200f..78ccaec19f8242e9c2c18114ccad99e616204aba 100644 (file)
@@ -183,3 +183,21 @@ _gdk_rgba_init_from_hsla (GdkRGBA       *rgba,
     }
 }
 
+void
+_gtk_hsla_shade (GtkHSLA       *dest,
+                 const GtkHSLA *src,
+                 double         factor)
+{
+  g_return_if_fail (dest != NULL);
+  g_return_if_fail (src != NULL);
+
+  dest->hue = src->hue;
+
+  dest->lightness = src->lightness * factor;
+  dest->lightness = CLAMP (dest->lightness, 0.0, 1.0);
+
+  dest->saturation = src->saturation * factor;
+  dest->saturation = CLAMP (dest->saturation, 0.0, 1.0);
+
+  dest->alpha = src->alpha;
+}