From 044077236a9a78b519254789e70f7ab23fde7e97 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 18 May 2006 03:27:51 +0000 Subject: [PATCH] avoid wxColour::Set(long) confusion git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/colourcmn.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 3969790771..3c238495d4 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -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 ? {