X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fcolor.cpp;h=d70ed3f752b1020d87ec7f726a48df31de959360;hb=76bc5e374b4f97da13e0ec38f3bd47f2704f864a;hp=7df6106e423c3cdf9407a3e88e448ce6253ac22c;hpb=e9904990d49499270dfe26a9ae85178a456b30aa;p=synfig.git 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));