1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/colour.h
3 // Purpose: wxColour class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/object.h"
16 #include "wx/string.h"
18 #include "wx/mac/corefoundation/cfref.h"
23 class WXDLLEXPORT wxColour
: public wxColourBase
31 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
39 ChannelType
Red() const { return m_red
; }
40 ChannelType
Green() const { return m_green
; }
41 ChannelType
Blue() const { return m_blue
; }
42 ChannelType
Alpha() const { return m_alpha
; }
45 bool operator == (const wxColour
& colour
) const;
47 bool operator != (const wxColour
& colour
) const { return !(*this == colour
); }
49 CGColorRef
GetPixel() const { return m_cgColour
; };
51 CGColorRef
GetCGColor() const { return m_cgColour
; };
52 CGColorRef
CreateCGColor() const { return wxCFRetain( (CGColorRef
)m_cgColour
); };
54 void GetRGBColor( RGBColor
*col
) const;
56 // Mac-specific ctor and assignment operator from the native colour
57 // assumes ownership of CGColorRef
58 wxColour( CGColorRef col
);
59 wxColour(const RGBColor
& col
);
60 wxColour
& operator=(const RGBColor
& col
);
61 wxColour
& operator=(CGColorRef col
);
67 InitRGBA(ChannelType r
, ChannelType g
, ChannelType b
, ChannelType a
);
68 void InitRGBColor( const RGBColor
& col
);
69 void InitCGColorRef( CGColorRef col
);
71 wxCFRef
<CGColorRef
> m_cgColour
;
78 DECLARE_DYNAMIC_CLASS(wxColour
)