From: dooglus Date: Sun, 13 Jan 2008 14:35:50 +0000 (+0000) Subject: In the hex HTML code text entry box of the color dialog, ignore everything other... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7c5adc60527fbc236a500ca73723d158e459f1a9;p=synfig.git In the hex HTML code text entry box of the color dialog, ignore everything other than hex characters. Previously even stray whitespace would cause it to fail. git-svn-id: http://svn.voria.com/code@1342 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/color.cpp b/synfig-core/trunk/src/synfig/color.cpp index 81be9eb..1fa133c 100644 --- a/synfig-core/trunk/src/synfig/color.cpp +++ b/synfig-core/trunk/src/synfig/color.cpp @@ -79,9 +79,16 @@ Color::real2hex(ColorReal c) } void -Color::set_hex(String& hex) +Color::set_hex(String& str) { value_type r, g, b; + String hex; + + // use just the hex characters + for (String::const_iterator iter = str.begin(); iter != str.end(); iter++) + if (isxdigit(*iter)) + hex.push_back(*iter); + try { if (hex.size() == 1)