]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/colour.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxColour class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "colour.h"
19 #include "wx/object.h"
20 #include "wx/string.h"
23 class WXDLLEXPORT wxColour
: public wxObject
25 DECLARE_DYNAMIC_CLASS(wxColour
)
28 wxColour(unsigned char r
, unsigned char g
, unsigned char b
);
29 wxColour(unsigned long colRGB
) { Set(colRGB
); }
30 wxColour(const wxColour
& col
);
31 wxColour(const wxString
& col
);
33 wxColour
& operator =(const wxColour
& src
) ;
34 wxColour
& operator =(const wxString
& src
) ;
35 inline int Ok() const { return (m_isInit
) ; }
37 void Set(unsigned char r
, unsigned char g
, unsigned char b
);
38 void Set(unsigned long colRGB
)
40 // we don't need to know sizeof(long) here because we assume that the three
41 // least significant bytes contain the R, G and B values
42 Set((unsigned char)colRGB
,
43 (unsigned char)(colRGB
>> 8),
44 (unsigned char)(colRGB
>> 16));
47 inline unsigned char Red() const { return m_red
; }
48 inline unsigned char Green() const { return m_green
; }
49 inline unsigned char Blue() const { return m_blue
; }
51 inline bool operator == (const wxColour
& colour
) { return (m_red
== colour
.m_red
&& m_green
== colour
.m_green
&& m_blue
== colour
.m_blue
); }
53 inline bool operator != (const wxColour
& colour
) { return (!(m_red
== colour
.m_red
&& m_green
== colour
.m_green
&& m_blue
== colour
.m_blue
)); }
56 WXCOLORREF GetPixel() const { return m_pixel; };
63 unsigned char m_green
;
65 /* TODO: implementation
70 #define wxColor wxColour