Allow a single hex digit in the hex color box. The digit is repeated 6 times, so...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 1 Apr 2007 08:54:36 +0000 (08:54 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 1 Apr 2007 08:54:36 +0000 (08:54 +0000)
git-svn-id: http://svn.voria.com/code@404 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index 7df6106..d70ed3f 100644 (file)
@@ -84,7 +84,12 @@ Color::set_hex(String& hex)
        value_type r, g, b;
        try
        {
-               if (hex.size() == 3)
+               if (hex.size() == 1)
+               {
+                       r = hex2real(hex.substr(0,1)+hex.substr(0,1));
+                       r_ = g_ = b_ = r;
+               }
+               else if (hex.size() == 3)
                {
                        r = hex2real(hex.substr(0,1)+hex.substr(0,1));
                        g = hex2real(hex.substr(1,1)+hex.substr(1,1));