]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/colour.tex
finished implementation for stencil and colored patterns
[wxWidgets.git] / docs / latex / wx / colour.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: colour.tex
3%% Purpose: wxColour docs
4%% Author:
5%% Modified by:
6%% Created:
7%% RCS-ID: $Id$
8%% Copyright: (c) wxWidgets
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxColour}}\label{wxcolour}
13
14A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values,
15and is used to determine drawing colours. See the
16entry for \helpref{wxColourDatabase}{wxcolourdatabase} for how a pointer to a predefined,
17named colour may be returned instead of creating a new colour.
18
19Valid RGB values are in the range 0 to 255.
20
21You can retrieve the current system colour settings with \helpref{wxSystemSettings}{wxsystemsettings}.
22
23\wxheading{Derived from}
24
25\helpref{wxObject}{wxobject}
26
27\wxheading{Include files}
28
29<wx/colour.h>
30
31\wxheading{Predefined objects}
32
33Objects:
34
35{\bf wxNullColour}
36
37Pointers:
38
39{\bf wxBLACK\\
40wxWHITE\\
41wxRED\\
42wxBLUE\\
43wxGREEN\\
44wxCYAN\\
45wxLIGHT\_GREY}
46
47\wxheading{See also}
48
49\helpref{wxColourDatabase}{wxcolourdatabase}, \helpref{wxPen}{wxpen}, \helpref{wxBrush}{wxbrush},\rtfsp
50\helpref{wxColourDialog}{wxcolourdialog}, \helpref{wxSystemSettings}{wxsystemsettings}
51
52\latexignore{\rtfignore{\wxheading{Members}}}
53
54
55\membersection{wxColour::wxColour}\label{wxcolourconstr}
56
57\func{}{wxColour}{\void}
58
59Default constructor.
60
61\func{}{wxColour}{\param{unsigned char}{ red}, \param{unsigned char}{ green}, \param{unsigned char}{ blue}}
62
63Constructs a colour from red, green and blue values.
64
65\func{}{wxColour}{\param{const wxString\& }{colourNname}}
66
67Constructs a colour object using a colour name
68listed in {\bf wxTheColourDatabase}.
69
70\func{}{wxColour}{\param{const wxColour\&}{ colour}}
71
72Copy constructor.
73
74\wxheading{Parameters}
75
76\docparam{red}{The red value.}
77
78\docparam{green}{The green value.}
79
80\docparam{blue}{The blue value.}
81
82\docparam{colourName}{The colour name.}
83
84\docparam{colour}{The colour to copy.}
85
86\wxheading{See also}
87
88\helpref{wxColourDatabase}{wxcolourdatabase}
89
90\pythonnote{Constructors supported by wxPython are:\par
91\indented{2cm}{\begin{twocollist}
92\twocolitem{{\bf wxColour(red=0, green=0, blue=0)}}{}
93\twocolitem{{\bf wxNamedColour(name)}}{}
94\end{twocollist}}
95}
96
97
98
99\membersection{wxColour::Blue}\label{wxcolourblue}
100
101\constfunc{unsigned char}{Blue}{\void}
102
103Returns the blue intensity.
104
105
106\membersection{wxColour::GetPixel}\label{wxcolourgetpixel}
107
108\constfunc{long}{GetPixel}{\void}
109
110Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
111On X, an allocated pixel value is returned.
112
113-1 is returned if the pixel is invalid (on X, unallocated).
114
115
116\membersection{wxColour::Green}\label{wxcolourgreen}
117
118\constfunc{unsigned char}{Green}{\void}
119
120Returns the green intensity.
121
122
123\membersection{wxColour::Ok}\label{wxcolourok}
124
125\constfunc{bool}{Ok}{\void}
126
127Returns \true if the colour object is valid (the colour has been initialised with RGB values).
128
129
130\membersection{wxColour::Red}\label{wxcolourred}
131
132\constfunc{unsigned char}{Red}{\void}
133
134Returns the red intensity.
135
136
137\membersection{wxColour::Set}\label{wxcolourset}
138
139\func{void}{Set}{\param{unsigned char}{ red}, \param{unsigned char}{ green}, \param{unsigned char}{ blue}}
140
141Sets the RGB intensity values.
142
143
144\membersection{wxColour::operator $=$}\label{wxcolourassign}
145
146\func{wxColour\&}{operator $=$}{\param{const wxColour\&}{ colour}}
147
148Assignment operator, taking another colour object.
149
150\func{wxColour\&}{operator $=$}{\param{const wxString\&}{ colourName}}
151
152Assignment operator, using a colour name to be found in the colour database.
153
154\wxheading{See also}
155
156\helpref{wxColourDatabase}{wxcolourdatabase}
157
158
159\membersection{wxColour::operator $==$}\label{wxcolourequality}
160
161\func{bool}{operator $==$}{\param{const wxColour\&}{ colour}}
162
163Tests the equality of two colours by comparing individual red, green blue colours.
164
165
166\membersection{wxColour::operator $!=$}\label{wxcolourinequality}
167
168\func{bool}{operator $!=$}{\param{const wxColour\&}{ colour}}
169
170Tests the inequality of two colours by comparing individual red, green blue colours.
171
172\section{\class{wxColourData}}\label{wxcolourdata}
173
174This class holds a variety of information related to colour dialogs.
175
176\wxheading{Derived from}
177
178\helpref{wxObject}{wxobject}
179
180\wxheading{Include files}
181
182<wx/cmndata.h>
183
184\wxheading{See also}
185
186\helpref{wxColour}{wxcolour}, \helpref{wxColourDialog}{wxcolourdialog}, \helpref{wxColourDialog overview}{wxcolourdialogoverview}
187
188\latexignore{\rtfignore{\wxheading{Members}}}
189
190
191\membersection{wxColourData::wxColourData}\label{wxcolourdatactor}
192
193\func{}{wxColourData}{\void}
194
195Constructor. Initializes the custom colours to {\tt wxNullColour},
196the {\it data colour} setting
197to black, and the {\it choose full} setting to true.
198
199
200\membersection{wxColourData::\destruct{wxColourData}}\label{wxcolourdatadtor}
201
202\func{}{\destruct{wxColourData}}{\void}
203
204Destructor.
205
206
207\membersection{wxColourData::GetChooseFull}\label{wxcolourdatagetchoosefull}
208
209\constfunc{bool}{GetChooseFull}{\void}
210
211Under Windows, determines whether the Windows colour dialog will display the full dialog
212with custom colour selection controls. Under PalmOS, determines whether colour dialog
213will display full rgb colour picker or only available palette indexer.
214Has no meaning under other platforms.
215
216The default value is true.
217
218
219\membersection{wxColourData::GetColour}\label{wxcolourdatagetcolour}
220
221\constfunc{wxColour\&}{GetColour}{\void}
222
223Gets the current colour associated with the colour dialog.
224
225The default colour is black.
226
227
228\membersection{wxColourData::GetCustomColour}\label{wxcolourdatagetcustomcolour}
229
230\constfunc{wxColour\&}{GetCustomColour}{\param{int}{ i}}
231
232Gets the {\it i}th custom colour associated with the colour dialog. {\it i} should
233be an integer between 0 and 15.
234
235The default custom colours are invalid colours.
236
237
238\membersection{wxColourData::SetChooseFull}\label{wxcolourdatasetchoosefull}
239
240\func{void}{SetChooseFull}{\param{const bool }{flag}}
241
242Under Windows, tells the Windows colour dialog to display the full dialog
243with custom colour selection controls. Under other platforms, has no effect.
244
245The default value is true.
246
247
248\membersection{wxColourData::SetColour}\label{wxcolourdatasetcolour}
249
250\func{void}{SetColour}{\param{const wxColour\&}{ colour}}
251
252Sets the default colour for the colour dialog.
253
254The default colour is black.
255
256
257\membersection{wxColourData::SetCustomColour}\label{wxcolourdatasetcustomcolour}
258
259\func{void}{SetCustomColour}{\param{int}{ i}, \param{const wxColour\&}{ colour}}
260
261Sets the {\it i}th custom colour for the colour dialog. {\it i} should
262be an integer between 0 and 15.
263
264The default custom colours are invalid colours.
265
266
267\membersection{wxColourData::operator $=$}\label{wxcolourdataassign}
268
269\func{void}{operator $=$}{\param{const wxColourData\&}{ data}}
270
271Assignment operator for the colour data.
272
273
274
275
276\section{\class{wxColourDatabase}}\label{wxcolourdatabase}
277
278wxWidgets maintains a database of standard RGB colours for a predefined
279set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
280application may add to this set if desired by using
281\helpref{AddColour}{wxcolourdatabaseaddcolour} and may use it to look up
282colours by names using \helpref{Find}{wxcolourdatabasefind} or find the names
283for the standard colour suing \helpref{FindName}{wxcolourdatabasefindname}.
284
285There is one predefined instance of this class called
286{\bf wxTheColourDatabase}.
287
288\wxheading{Derived from}
289
290None
291
292\wxheading{Include files}
293
294<wx/gdicmn.h>
295
296\wxheading{Remarks}
297
298The standard database contains at least the following colours:
299
300AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
301CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
302ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
303FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
304INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
305MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
306MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
307MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
308NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
309SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
310BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
311YELLOW GREEN.
312
313\wxheading{See also}
314
315\helpref{wxColour}{wxcolour}
316
317\latexignore{\rtfignore{\wxheading{Members}}}
318
319
320\membersection{wxColourDatabase::wxColourDatabase}\label{wxcolourdatabaseconstr}
321
322\func{}{wxColourDatabase}{\void}
323
324Constructs the colour database. It will be initialized at the first use.
325
326
327\membersection{wxColourDatabase::AddColour}\label{wxcolourdatabaseaddcolour}
328
329\func{void}{AddColour}{\param{const wxString\& }{colourName}, \param{const wxColour\&}{colour}}
330
331\func{void}{AddColour}{\param{const wxString\& }{colourName}, \param{wxColour* }{colour}}
332
333Adds a colour to the database. If a colour with the same name already exists,
334it is replaced.
335
336Please note that the overload taking a pointer is deprecated and will be
337removed in the next wxWidgets version, please don't use it.
338
339
340\membersection{wxColourDatabase::Find}\label{wxcolourdatabasefind}
341
342\func{wxColour}{Find}{\param{const wxString\& }{colourName}}
343
344Finds a colour given the name. Returns an invalid colour object (that is, such
345that its \helpref{Ok()}{wxcolourok} method returns \false) if the colour wasn't
346found in the database.
347
348
349\membersection{wxColourDatabase::FindName}\label{wxcolourdatabasefindname}
350
351\constfunc{wxString}{FindName}{\param{const wxColour\&}{ colour}}
352
353Finds a colour name given the colour. Returns an empty string if the colour is
354not found in the database.
355
356