aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-02-19 09:36:04 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-02-19 09:36:04 +0800
commitfd564be3203400024147469faaa7de0884861566 (patch)
tree80e69ff89307a7393193520e0f2fe51cdc21540e /e-util/e-util.c
parent7ed5f59771262651ee8b0d29a123e43a6ac0b6c6 (diff)
downloadgsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.tar
gsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.tar.gz
gsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.tar.bz2
gsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.tar.lz
gsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.tar.xz
gsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.tar.zst
gsoc2013-evolution-fd564be3203400024147469faaa7de0884861566.zip
Clean up the EMFormat stack. Add some GObject properties to bind to.
Add some handy color conversion functions to e-util. svn path=/branches/kill-bonobo/; revision=37290
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index a5e6c6b548..c65fcbceaf 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -432,6 +432,30 @@ e_write_file_uri (const gchar *filename, const gchar *data)
return res;
}
+/**
+ * e_color_to_value:
+ * color: a #GdkColor
+ *
+ * Converts a #GdkColor to a 24-bit RGB color value.
+ *
+ * Returns: a 24-bit color value
+ **/
+guint32
+e_color_to_value (GdkColor *color)
+{
+ guint16 red;
+ guint16 green;
+ guint16 blue;
+
+ g_return_val_if_fail (color != NULL, 0);
+
+ red = color->red >> 8;
+ green = color->green >> 8;
+ blue = color->blue >> 8;
+
+ return (guint32) (((red << 16) | (green << 8) | blue) & 0xffffff);
+}
+
static gint
epow10 (gint number)
{