]>
git.saurik.com Git - wxWidgets.git/blob - src/stubs/colour.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxColour class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "colour.h"
16 #include "wx/gdicmn.h"
17 #include "wx/colour.h"
19 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
)
26 m_red
= m_blue
= m_green
= 0;
32 wxColour::wxColour (unsigned char r
, unsigned char g
, unsigned char b
)
39 m_pixel = PALETTERGB (m_red, m_green, m_blue);
43 wxColour::wxColour (const wxColour
& col
)
46 m_green
= col
.m_green
;
48 m_isInit
= col
.m_isInit
;
50 m_pixel = col.m_pixel;
54 wxColour
& wxColour::operator =(const wxColour
& col
)
57 m_green
= col
.m_green
;
59 m_isInit
= col
.m_isInit
;
61 m_pixel = col.m_pixel;
66 void wxColour::InitFromName(const wxString
& col
)
68 wxColour
*the_colour
= wxTheColourDatabase
->FindColour (col
);
71 m_red
= the_colour
->Red ();
72 m_green
= the_colour
->Green ();
73 m_blue
= the_colour
->Blue ();
84 m_pixel = PALETTERGB (m_red, m_green, m_blue);
88 wxColour::~wxColour ()
92 void wxColour::Set (unsigned char r
, unsigned char g
, unsigned char b
)
99 m_pixel = PALETTERGB (m_red, m_green, m_blue);