accept SVG color names in the hex entry. Not very intuitive but probably a

2004-07-26  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorscales.c (gimp_color_scales_hex_events):
	accept SVG color names in the hex entry. Not very intuitive but
	probably a nice experts feature and it can be improved later.
This commit is contained in:
Sven Neumann 2004-07-26 12:07:01 +00:00 committed by Sven Neumann
parent 3d05015a24
commit 0cb50e20f2
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2004-07-26 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpcolorscales.c (gimp_color_scales_hex_events):
accept SVG color names in the hex entry. Not very intuitive but
probably a nice experts feature and it can be improved later.
2004-07-26 Michael Natterer <mitch@gimp.org>
* app/main.c (main): use #ifdef GIMP_UNSTABLE instead of looking

View File

@ -491,10 +491,11 @@ gimp_color_scales_hex_events (GtkWidget *widget,
gimp_rgb_get_uchar (&selector->rgb, &r, &g, &b);
g_snprintf (buffer, sizeof (buffer), "%.2x%.2x%.2x", r, g, b);
if ((strlen (hex_color) == 6) &&
(g_ascii_strcasecmp (buffer, hex_color) != 0))
if (g_ascii_strcasecmp (buffer, hex_color) != 0)
{
if (gimp_rgb_parse_hex (&selector->rgb, hex_color, 6))
if ((strlen (hex_color) == 6 &&
gimp_rgb_parse_hex (&selector->rgb, hex_color, 6)) ||
(gimp_rgb_parse_name (&selector->rgb, hex_color, -1)))
{
gimp_rgb_to_hsv (&selector->rgb, &selector->hsv);
@ -504,9 +505,9 @@ gimp_color_scales_hex_events (GtkWidget *widget,
return FALSE;
}
}
gtk_entry_set_text (GTK_ENTRY (widget), buffer);
gtk_entry_set_text (GTK_ENTRY (widget), buffer);
}
break;
default: