]> git.saurik.com Git - wxWidgets.git/blame - src/generic/colour.cpp
moved assertdlg_gtk.[ch] to GTK_LOWLEVEL_SRC/HDR to fix wxUniv/GTK build
[wxWidgets.git] / src / generic / colour.cpp
CommitLineData
32b8ec41 1/////////////////////////////////////////////////////////////////////////////
3da12c22 2// Name: src/generic/colour.cpp
32b8ec41
VZ
3// Purpose: wxColour class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
e3a1e3e0 8// Copyright: (c) Julian Smart
edc536d3 9// Licence: wxWindows licence
32b8ec41
VZ
10/////////////////////////////////////////////////////////////////////////////
11
32b8ec41
VZ
12// For compilers that support precompilation, includes "wx.h".
13#include "wx/wxprec.h"
14
15#ifdef __BORLANDC__
40989e46 16 #pragma hdrstop
32b8ec41
VZ
17#endif
18
7cf41a5d
WS
19#include "wx/colour.h"
20
dd05139a
WS
21#ifndef WX_PRECOMP
22 #include "wx/gdicmn.h"
23#endif
32b8ec41
VZ
24
25IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
26
27// Colour
28
564a150b 29void wxColour::Init()
32b8ec41 30{
564a150b
VZ
31 m_red =
32 m_blue =
33 m_green = 0;
7f5426f0 34 m_alpha = wxALPHA_OPAQUE;
aad6765c 35 m_isInit = false;
32b8ec41
VZ
36}
37
1c53456f
VS
38wxColour::wxColour()
39{
40 Init();
41}
42
32b8ec41
VZ
43wxColour::wxColour(const wxColour& col)
44{
564a150b 45 *this = col;
32b8ec41
VZ
46}
47
7f5426f0 48wxColour& wxColour::operator=(const wxColour& col)
32b8ec41 49{
564a150b
VZ
50 m_red = col.m_red;
51 m_green = col.m_green;
52 m_blue = col.m_blue;
7f5426f0 53 m_alpha = col.m_alpha;
564a150b
VZ
54 m_isInit = col.m_isInit;
55 return *this;
32b8ec41
VZ
56}
57
32b8ec41
VZ
58wxColour::~wxColour()
59{
60}
61
aea95b1c
VZ
62void wxColour::InitRGBA(unsigned char r,
63 unsigned char g,
64 unsigned char b,
7f5426f0 65 unsigned char a)
32b8ec41 66{
564a150b
VZ
67 m_red = r;
68 m_green = g;
69 m_blue = b;
7f5426f0 70 m_alpha = a;
aad6765c 71 m_isInit = true;
32b8ec41 72}