]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid wxColour::Set(long) confusion
authorPaul Cornett <paulcor@bullseye.com>
Thu, 18 May 2006 03:27:51 +0000 (03:27 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 18 May 2006 03:27:51 +0000 (03:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/colourcmn.cpp

index 3969790771510fde07ba214fc63e4c8601769740..3c238495d4633fc4c81a1b7ef5871d0109959c9b 100644 (file)
@@ -54,10 +54,12 @@ bool wxColourBase::FromString(const wxChar *str)
     {
         // hexadecimal prefixed with # (HTML syntax)
         unsigned long tmp;
-        if (wxSscanf(&str[1], wxT("%lX"), &tmp) != 1)
+        if (wxSscanf(&str[1], wxT("%lx"), &tmp) != 1)
             return false;
 
-        Set(tmp);   // set from packed long
+        Set((unsigned char)(tmp >> 16),
+            (unsigned char)(tmp >> 8),
+            (unsigned char)tmp);
     }
     else if (wxTheColourDatabase) // a colour name ?
     {