From f36bee599c43c436f6da4902318eabe376f30384 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 27 Oct 2007 12:14:18 +0000 Subject: [PATCH] 2007-10-27 Emmanuele Bassi * clutter/clutter-color.c (clutter_color_to_string): Update the documentation for the format of the returned string, and remove the note: now clutter_color_parse() can parse the string this function returns. --- ChangeLog | 7 +++++++ clutter/clutter-color.c | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 664372f93..e9b855522 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-27 Emmanuele Bassi + + * clutter/clutter-color.c (clutter_color_to_string): Update the + documentation for the format of the returned string, and remove + the note: now clutter_color_parse() can parse the string this + function returns. + 2007-10-27 Emmanuele Bassi * clutter/pango/pangoclutter-render.c: Last usage of guint diff --git a/clutter/clutter-color.c b/clutter/clutter-color.c index e470c3a5d..11722bb0d 100644 --- a/clutter/clutter-color.c +++ b/clutter/clutter-color.c @@ -485,22 +485,24 @@ clutter_color_parse (const gchar *color, { gint32 result; - if (sscanf (color+1, "%x", &result)) + if (sscanf (color + 1, "%x", &result)) { - if (strlen(color) == 9) + if (strlen (color) == 9) { dest->red = result >> 24 & 0xff; dest->green = (result >> 16) & 0xff; dest->blue = (result >> 8) & 0xff; dest->alpha = result & 0xff; + return TRUE; } - else if (strlen(color) == 7) + else if (strlen (color) == 7) { dest->red = (result >> 16) & 0xff; dest->green = (result >> 8) & 0xff; dest->blue = result & 0xff; dest->alpha = 0xff; + return TRUE; } } @@ -513,6 +515,7 @@ clutter_color_parse (const gchar *color, dest->green = pango_color.green; dest->blue = pango_color.blue; dest->alpha = 0xff; + return TRUE; } @@ -524,14 +527,11 @@ clutter_color_parse (const gchar *color, * @color: a #ClutterColor * * Returns a textual specification of @color in the hexadecimal form - * #rrrrggggbbbbaaaa, where r, + * #rrggbbaa, where r, * g, b and a are * hex digits representing the red, green, blue and alpha components * respectively. * - * Note: the returned string cannot be used to get the color back with - * clutter_color_parse(). - * * Return value: a newly-allocated text string * * Since: 0.2