X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7270921da6b811197803be41e972dd81a4abd97c..9fd8f2dd3df305448a0c2d56508c04e26385a76d:/src/common/colourcmn.cpp?ds=sidebyside diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 3969790771..a77017922f 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -22,10 +22,12 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/utils.h" + #include "wx/gdicmn.h" #endif -#include "wx/gdicmn.h" - +#if wxUSE_VARIANT +IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT) +#endif // ============================================================================ // wxString <-> wxColour conversions @@ -54,10 +56,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 ? {