#include "wx/gdiobj.h"
+class WXDLLEXPORT wxColour;
+
// the standard wxColour constructors;
// this macro avoids to repeat these lines across all colour.h files, since
// Set() is a virtual function and thus cannot be called by wxColourBase
#define wxC2S_HTML_SYNTAX 4 // return colour in #rrggbb syntax
-class WXDLLEXPORT wxColour;
-
const unsigned char wxALPHA_TRANSPARENT = 0;
const unsigned char wxALPHA_OPAQUE = 0xff;
+// ----------------------------------------------------------------------------
+// wxVariant support
+// ----------------------------------------------------------------------------
+
+#if wxUSE_VARIANT
+#include "wx/variant.h"
+DECLARE_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT)
+#endif
+
//-----------------------------------------------------------------------------
// wxColourBase: this class has no data members, just some functions to avoid
// code redundancy in all native wxColour implementations
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
- Set((ChannelType)colRGB,
- (ChannelType)(colRGB >> 8),
- (ChannelType)(colRGB >> 16));
+ Set((ChannelType)(0xFF & colRGB),
+ (ChannelType)(0xFF & (colRGB >> 8)),
+ (ChannelType)(0xFF & (colRGB >> 16)));
}
// accessors
// ---------
- virtual bool Ok() const = 0;
+ virtual bool Ok() const { return IsOk(); }
+ virtual bool IsOk() const = 0;
virtual ChannelType Red() const = 0;
virtual ChannelType Green() const = 0;