From: dooglus Date: Sun, 1 Apr 2007 08:54:36 +0000 (+0000) Subject: Allow a single hex digit in the hex color box. The digit is repeated 6 times, so... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=07da59469b799f82e19a99fc4b612d8240d70406;p=synfig.git Allow a single hex digit in the hex color box. The digit is repeated 6 times, so "0" gives black (0x000000) and "f" gives white (0xffffff). git-svn-id: http://svn.voria.com/code@404 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/color.cpp b/synfig-core/trunk/src/synfig/color.cpp index 7df6106..d70ed3f 100644 --- a/synfig-core/trunk/src/synfig/color.cpp +++ b/synfig-core/trunk/src/synfig/color.cpp @@ -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));