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