diff --git a/ChangeLog b/ChangeLog index b5c1c93ca0..8c8c51c085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-07-27 Sven Neumann + + * libgimpwidgets/gimpcolorhexentry.c (gimp_color_hex_entry_events): + also accept the short hexadecimal notation (3 hex digits). + 2004-07-26 Sven Neumann * libgimpwidgets/Makefile.am (libgimpwidgetsinclude_HEADERS): diff --git a/libgimpwidgets/gimpcolorhexentry.c b/libgimpwidgets/gimpcolorhexentry.c index 537d160b11..dbf89616db 100644 --- a/libgimpwidgets/gimpcolorhexentry.c +++ b/libgimpwidgets/gimpcolorhexentry.c @@ -262,9 +262,11 @@ gimp_color_hex_entry_events (GtkWidget *widget, if (g_ascii_strcasecmp (buffer, text) != 0) { GimpRGB color; + gsize len = strlen (text); - if ((strlen (text) == 6 && gimp_rgb_parse_hex (&color, text, 6)) || - (gimp_rgb_parse_name (&color, text, -1))) + if (len > 0&& + ((len % 3 == 0 && gimp_rgb_parse_hex (&color, text, len)) || + (gimp_rgb_parse_name (&color, text, -1)))) { gimp_color_hex_entry_set_color (entry, &color); }