]>
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 #if !USE_SHARED_LIBRARY
20 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
)
28 m_red
= m_blue
= m_green
= 0;
34 wxColour::wxColour (unsigned char r
, unsigned char g
, unsigned char b
)
41 m_pixel = PALETTERGB (m_red, m_green, m_blue);
45 wxColour::wxColour (const wxColour
& col
)
48 m_green
= col
.m_green
;
50 m_isInit
= col
.m_isInit
;
52 m_pixel = col.m_pixel;
56 wxColour
& wxColour::operator =(const wxColour
& col
)
59 m_green
= col
.m_green
;
61 m_isInit
= col
.m_isInit
;
63 m_pixel = col.m_pixel;
68 wxColour::wxColour (const wxString
& col
)
70 wxColour
*the_colour
= wxTheColourDatabase
->FindColour (col
);
73 m_red
= the_colour
->Red ();
74 m_green
= the_colour
->Green ();
75 m_blue
= the_colour
->Blue ();
86 m_pixel = PALETTERGB (m_red, m_green, m_blue);
90 wxColour::~wxColour ()
94 wxColour
& wxColour::operator = (const wxString
& col
)
96 wxColour
*the_colour
= wxTheColourDatabase
->FindColour (col
);
99 m_red
= the_colour
->Red ();
100 m_green
= the_colour
->Green ();
101 m_blue
= the_colour
->Blue ();
112 m_pixel = PALETTERGB (m_red, m_green, m_blue);
117 void wxColour::Set (unsigned char r
, unsigned char g
, unsigned char b
)
124 m_pixel = PALETTERGB (m_red, m_green, m_blue);