]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/colour.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxColour class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 #include "wx/gdicmn.h"
20 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
)
28 m_red
= m_blue
= m_green
= 0;
31 wxColour::wxColour (unsigned char r
, unsigned char g
, unsigned char b
)
37 // m_pixel = PALETTERGB (m_red, m_green, m_blue);
40 wxColour::wxColour (const wxColour
& col
)
43 m_green
= col
.m_green
;
45 m_isInit
= col
.m_isInit
;
46 m_pixel
= col
.m_pixel
;
49 wxColour
& wxColour::operator =(const wxColour
& col
)
52 m_green
= col
.m_green
;
54 m_isInit
= col
.m_isInit
;
55 m_pixel
= col
.m_pixel
;
59 void wxColour::InitFromName(const wxString
& col
)
61 wxColour
*the_colour
= wxTheColourDatabase
->FindColour (col
);
64 m_red
= the_colour
->Red ();
65 m_green
= the_colour
->Green ();
66 m_blue
= the_colour
->Blue ();
77 m_pixel = PALETTERGB (m_red, m_green, m_blue);
81 wxColour::~wxColour ()
85 void wxColour::Set (unsigned char r
, unsigned char g
, unsigned char b
)
92 m_pixel = PALETTERGB (m_red, m_green, m_blue);
97 #if WXWIN_COMPATIBILITY
98 void wxColour::Get (unsigned char *r
, unsigned char *g
, unsigned char *b
) const