]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/qt/colour.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxColour class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "colour.h"
20 class WXDLLEXPORT wxColour
: public wxObject
22 DECLARE_DYNAMIC_CLASS(wxColour
)
25 wxColour(unsigned char r
, unsigned char g
, unsigned char b
);
26 wxColour(unsigned long colRGB
) { Set(colRGB
); }
27 wxColour(const wxColour
& col
);
28 wxColour(const wxString
& col
);
30 wxColour
& operator =(const wxColour
& src
) ;
31 wxColour
& operator =(const wxString
& src
) ;
32 inline int Ok() const { return (m_isInit
) ; }
34 void Set(unsigned char r
, unsigned char g
, unsigned char b
);
35 void Set(unsigned long colRGB
)
37 // we don't need to know sizeof(long) here because we assume that the three
38 // least significant bytes contain the R, G and B values
39 Set((unsigned char)colRGB
,
40 (unsigned char)(colRGB
>> 8),
41 (unsigned char)(colRGB
>> 16));
44 inline unsigned char Red() const { return m_red
; }
45 inline unsigned char Green() const { return m_green
; }
46 inline unsigned char Blue() const { return m_blue
; }
48 inline bool operator == (const wxColour
& colour
) { return (m_red
== colour
.m_red
&& m_green
== colour
.m_green
&& m_blue
== colour
.m_blue
); }
50 inline bool operator != (const wxColour
& colour
) { return (!(m_red
== colour
.m_red
&& m_green
== colour
.m_green
&& m_blue
== colour
.m_blue
)); }
52 WXCOLORREF
GetPixel() const { return m_pixel
; };
58 unsigned char m_green
;
60 /* TODO: implementation
65 #define wxColor wxColour