]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/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"
20 class WXDLLEXPORT wxColour
: public wxObject
22 DECLARE_DYNAMIC_CLASS(wxColour
)
25 wxColour(const unsigned char r
, const unsigned char g
, const 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(void) 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 // Let's remove this inelegant function
45 #if WXWIN_COMPATIBILITY
46 void Get(unsigned char *r
, unsigned char *g
, unsigned char *b
) const;
49 inline unsigned char Red(void) const { return m_red
; }
50 inline unsigned char Green(void) const { return m_green
; }
51 inline unsigned char Blue(void) const { return 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
); }
55 inline bool operator != (const wxColour
& colour
) { return (!(m_red
== colour
.m_red
&& m_green
== colour
.m_green
&& m_blue
== colour
.m_blue
)); }
57 WXCOLORREF
GetPixel(void) const { return m_pixel
; };
63 unsigned char m_green
;
68 #define wxColor wxColour