In the hex HTML code text entry box of the color dialog, ignore everything other...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 13 Jan 2008 14:35:50 +0000 (14:35 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 13 Jan 2008 14:35:50 +0000 (14:35 +0000)
git-svn-id: http://svn.voria.com/code@1342 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/color.cpp

index 81be9eb..1fa133c 100644 (file)
@@ -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)