]>
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 #if !USE_SHARED_LIBRARY
21 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
)
30 m_red
= m_blue
= m_green
= 0;
33 wxColour::wxColour (unsigned char r
, unsigned char g
, unsigned char b
)
39 // m_pixel = PALETTERGB (m_red, m_green, m_blue);
42 wxColour::wxColour (const wxColour
& col
)
45 m_green
= col
.m_green
;
47 m_isInit
= col
.m_isInit
;
48 m_pixel
= col
.m_pixel
;
51 wxColour
& wxColour::operator =(const wxColour
& col
)
54 m_green
= col
.m_green
;
56 m_isInit
= col
.m_isInit
;
57 m_pixel
= col
.m_pixel
;
61 void wxColour::InitFromName(const wxString
& col
)
63 wxColour
*the_colour
= wxTheColourDatabase
->FindColour (col
);
66 m_red
= the_colour
->Red ();
67 m_green
= the_colour
->Green ();
68 m_blue
= the_colour
->Blue ();
79 m_pixel = PALETTERGB (m_red, m_green, m_blue);
83 wxColour::~wxColour ()
87 void wxColour::Set (unsigned char r
, unsigned char g
, unsigned char b
)
94 m_pixel = PALETTERGB (m_red, m_green, m_blue);
99 #if WXWIN_COMPATIBILITY
100 void wxColour::Get (unsigned char *r
, unsigned char *g
, unsigned char *b
) const