1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/x11/colour.h
3 // Purpose: wxColour class
4 // Author: Julian Smart, Robert Roebling
8 // Copyright: (c) Julian Smart, Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #include "wx/object.h"
17 #include "wx/string.h"
18 #include "wx/gdiobj.h"
19 #include "wx/palette.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_FWD_CORE wxDC
;
26 class WXDLLIMPEXP_FWD_CORE wxPaintDC
;
27 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
28 class WXDLLIMPEXP_FWD_CORE wxWindow
;
30 class WXDLLIMPEXP_FWD_CORE wxColour
;
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 class WXDLLEXPORT wxColour
: public wxColourBase
43 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
47 bool IsOk() const { return m_refData
!= NULL
; }
49 bool operator == ( const wxColour
& col
) const;
50 bool operator != ( const wxColour
& col
) const { return !(*this == col
); }
52 unsigned char Red() const;
53 unsigned char Green() const;
54 unsigned char Blue() const;
56 // Implementation part
58 void CalcPixel( WXColormap cmap
);
59 unsigned long GetPixel() const;
60 WXColor
*GetColor() const;
64 virtual wxObjectRefData
*CreateRefData() const;
65 virtual wxObjectRefData
*CloneRefData(const wxObjectRefData
*data
) const;
68 InitRGBA(unsigned char r
, unsigned char g
, unsigned char b
, unsigned char a
);
70 virtual bool FromString(const wxString
& str
);
73 DECLARE_DYNAMIC_CLASS(wxColour
)