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
37 bool Ok() const { return IsOk(); }
40 ChannelType
Red() const { return m_red
; }
41 ChannelType
Green() const { return m_green
; }
42 ChannelType
Blue() const { return m_blue
; }
43 ChannelType
Alpha() const { return m_alpha
; }
46 bool operator == (const wxColour
& colour
) const;
48 bool operator != (const wxColour
& colour
) const { return !(*this == colour
); }
50 CGColorRef
GetPixel() const { return m_cgColour
; };
52 CGColorRef
GetCGColor() const { return m_cgColour
; };
53 CGColorRef
CreateCGColor() const { return wxCFRetain( (CGColorRef
)m_cgColour
); };
55 void GetRGBColor( RGBColor
*col
) const;
57 // Mac-specific ctor and assignment operator from the native colour
58 // assumes ownership of CGColorRef
59 wxColour( CGColorRef col
);
60 wxColour(const RGBColor
& col
);
61 wxColour
& operator=(const RGBColor
& col
);
62 wxColour
& operator=(CGColorRef col
);
68 InitRGBA(ChannelType r
, ChannelType g
, ChannelType b
, ChannelType a
);
69 void InitRGBColor( const RGBColor
& col
);
70 void InitCGColorRef( CGColorRef col
);
72 wxCFRef
<CGColorRef
> m_cgColour
;
79 DECLARE_DYNAMIC_CLASS(wxColour
)