]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/colour.tex
Added first batch of docs and notes for wxPython.
[wxWidgets.git] / docs / latex / wx / colour.tex
CommitLineData
a660d684
KB
1\section{\class{wxColour}}\label{wxcolour}
2
3A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values,
4and is used to determine drawing colours. See the
5entry for \helpref{wxColourDatabase}{wxcolourdatabase} for how a pointer to a predefined,
6named colour may be returned instead of creating a new colour.
7
8Valid RGB values are in the range 0 to 255.
9
10\wxheading{Derived from}
11
12\helpref{wxObject}{wxobject}
13
954b8ae6
JS
14\wxheading{Include files}
15
16<wx/colour.h>
17
a660d684
KB
18\wxheading{See also}
19
20\helpref{wxColourDatabase}{wxcolourdatabase}, \helpref{wxPen}{wxpen}, \helpref{wxBrush}{wxbrush},\rtfsp
21\helpref{wxColourDialog}{wxcolourdialog}
22
23\latexignore{\rtfignore{\wxheading{Members}}}
24
25\membersection{wxColour::wxColour}\label{wxcolourconstr}
26
27\func{}{wxColour}{\void}
28
29Default constructor.
30
31\func{}{wxColour}{\param{const unsigned char}{ red}, \param{const unsigned char}{ green}, \param{const unsigned char}{ blue}}
32
33Constructs a colour from red, green and blue values.
34
35\func{}{wxColour}{\param{const wxString\& }{colourNname}}
36
37Constructs a colour object using a colour name
38listed in {\bf wxTheColourDatabase}.
39
1e6d9499
JS
40\func{}{wxColour}{\param{const wxColour\&}{ colour}}
41
42Copy constructor.
43
a660d684
KB
44\wxheading{Parameters}
45
46\docparam{red}{The red value.}
47
48\docparam{green}{The green value.}
49
50\docparam{blue}{The blue value.}
51
52\docparam{colourName}{The colour name.}
53
1e6d9499
JS
54\docparam{colour}{The colour to copy.}
55
a660d684
KB
56\wxheading{See also}
57
58\helpref{wxColourDatabase}{wxcolourdatabase}
59
06d20283
RD
60\pythonnote{Constructors supported by wxPython are:\par
61\indented{2cm}{\begin{twocollist}
62\twocolitem{\bf{wxColour(red=0, green=0, blue=0)}}{}
63\twocolitem{\bf{wxNamedColour(name)}}{}
64\end{twocollist}}
65}
66
67
a660d684
KB
68\membersection{wxColour::Blue}\label{wxcolourblue}
69
70\constfunc{unsigned char}{Blue}{\void}
71
72Returns the blue intensity.
73
74\membersection{wxColour::GetPixel}\label{wxcolourgetpixel}
75
76\constfunc{long}{GetPixel}{\void}
77
78Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
79On X, an allocated pixel value is returned.
80
81-1 is returned if the pixel is invalid (on X, unallocated).
82
83\membersection{wxColour::Green}\label{wxcolourgreen}
84
85\constfunc{unsigned char}{Green}{\void}
86
87Returns the green intensity.
88
89\membersection{wxColour::Ok}\label{wxcolourok}
90
91\constfunc{bool}{Ok}{\void}
92
93Returns TRUE if the colour object is valid (the colour has been initialised with RGB values).
94
95\membersection{wxColour::Red}\label{wxcolourred}
96
97\constfunc{unsigned char}{Red}{\void}
98
99Returns the red intensity.
100
101\membersection{wxColour::Set}\label{wxcolourset}
102
103\func{void}{Set}{\param{const unsigned char}{ red}, \param{const unsigned char}{ green}, \param{const unsigned char}{ blue}}
104
105Sets the RGB intensity values.
106
107\membersection{wxColour::operator $=$}\label{wxcolourassign}
108
109\func{wxColour\&}{operator $=$}{\param{const wxColour\&}{ colour}}
110
111Assignment operator, taking another colour object.
112
113\func{wxColour\&}{operator $=$}{\param{const wxString\&}{ colourName}}
114
115Assignment operator, using a colour name to be found in the colour database.
116
117\wxheading{See also}
118
119\helpref{wxColourDatabase}{wxcolourdatabase}
120
121\membersection{wxColour::operator $==$}\label{wxcolourequality}
122
123\func{bool}{operator $==$}{\param{const wxColour\&}{ colour}}
124
125Tests the equality of two colours by comparing individual red, green blue colours.
126
a660d684
KB
127\membersection{wxColour::operator $!=$}\label{wxcolourinequality}
128
129\func{bool}{operator $!=$}{\param{const wxColour\&}{ colour}}
130
131Tests the inequality of two colours by comparing individual red, green blue colours.
132
a660d684
KB
133\section{\class{wxColourData}}\label{wxcolourdata}
134
135This class holds a variety of information related to colour dialogs.
136
137\wxheading{Derived from}
138
139\helpref{wxObject}{wxobject}
140
954b8ae6
JS
141\wxheading{Include files}
142
143<wx/cmndata.h>
144
a660d684
KB
145\wxheading{See also}
146
147\helpref{wxColour}{wxcolour}, \helpref{wxColourDialog}{wxcolourdialog}, \helpref{wxColourDialog overview}{wxcolourdialogoverview}
148
149\latexignore{\rtfignore{\wxheading{Members}}}
150
151\membersection{wxColourData::wxColourData}\label{wxcolourdataconstr}
152
153\func{}{wxColourData}{\void}
154
155Constructor. Initializes the custom colours to white, the {\it data colour} setting
156to black, and the {\it choose full} setting to TRUE.
157
158\membersection{wxColourData::\destruct{wxColourData}}
159
160\func{}{\destruct{wxColourData}}{\void}
161
162Destructor.
163
164\membersection{wxColourData::GetChooseFull}\label{wxcolourdatagetchoosefull}
165
166\constfunc{bool}{GetChooseFull}{\void}
167
168Under Windows, determines whether the Windows colour dialog will display the full dialog
169with custom colour selection controls. Has no meaning under other platforms.
170
171The default value is TRUE.
172
173\membersection{wxColourData::GetColour}\label{wxcolourdatagetcolour}
174
175\constfunc{wxColour\&}{GetColour}{\void}
176
177Gets the current colour associated with the colour dialog.
178
179The default colour is black.
180
181\membersection{wxColourData::GetCustomColour}\label{wxcolourdatagetcustomcolour}
182
eaaa6a06 183\constfunc{wxColour\&}{GetCustomColour}{\param{int}{ i}}
a660d684
KB
184
185Gets the {\it i}th custom colour associated with the colour dialog. {\it i} should
186be an integer between 0 and 15.
187
188The default custom colours are all white.
189
190\membersection{wxColourData::SetChooseFull}\label{wxcolourdatasetchoosefull}
191
192\func{void}{SetChooseFull}{\param{const bool }{flag}}
193
194Under Windows, tells the Windows colour dialog to display the full dialog
195with custom colour selection controls. Under other platforms, has no effect.
196
197The default value is TRUE.
198
199\membersection{wxColourData::SetColour}\label{wxcolourdatasetcolour}
200
201\func{void}{SetColour}{\param{const wxColour\&}{ colour}}
202
203Sets the default colour for the colour dialog.
204
205The default colour is black.
206
207\membersection{wxColourData::SetCustomColour}\label{wxcolourdatasetcustomcolour}
208
eaaa6a06 209\func{void}{SetColour}{\param{int}{ i}, \param{const wxColour\&}{ colour}}
a660d684
KB
210
211Sets the {\it i}th custom colour for the colour dialog. {\it i} should
212be an integer between 0 and 15.
213
214The default custom colours are all white.
215
216\membersection{wxColourData::operator $=$}\label{wxcolourdataassign}
217
218\func{void}{operator $=$}{\param{const wxColourData\&}{ data}}
219
220Assingment operator for the colour data.
221
222\section{\class{wxColourDatabase}}\label{wxcolourdatabase}
223
224wxWindows maintains a database of standard RGB colours for a predefined
225set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
226application may add to this set if desired by using {\it Append}. There
227is only one instance of this class: {\bf wxTheColourDatabase}.
228
229\wxheading{Derived from}
230
231\helpref{wxList}{wxlist}\\
232\helpref{wxObject}{wxobject}
233
954b8ae6
JS
234\wxheading{Include files}
235
236<wx/gdicmn.h>
237
a660d684
KB
238\wxheading{Remarks}
239
240The colours in the standard database are as follows:
241
242AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
243CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
244ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
245FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
246INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
247MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
248MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
249MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
250NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
251SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
252BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
253YELLOW GREEN.
254
255\wxheading{See also}
256
257\helpref{wxColour}{wxcolour}
258
259\latexignore{\rtfignore{\wxheading{Members}}}
260
261\membersection{wxColourDatabase::wxColourDatabase}\label{wxcolourdatabaseconstr}
262
263\func{}{wxColourDatabase}{\void}
264
265Constructs the colour database.
266
267\membersection{wxColourDatabase::FindColour}\label{wxcolourdatabasefindcolour}
268
269\func{wxColour*}{FindColour}{\param{const wxString\& }{colourName}}
270
271Finds a colour given the name. Returns NULL if not found.
272
273\membersection{wxColourDatabase::FindName}\label{wxcolourdatabasefindname}
274
275\constfunc{wxString}{FindName}{\param{const wxColour\&}{ colour}}
276
277Finds a colour name given the colour. Returns NULL if not found.
278
279\membersection{wxColourDatabase::Initialize}\label{wxcolourdatabaseinitialize}
280
281\func{void}{Initialize}{\void}
282
283Initializes the database with a number of stock colours. Called by wxWindows
284on start-up.
285
286