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