1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxColour docs
8 %% Copyright: (c) wxWidgets
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxColour
}}\label{wxcolour
}
14 A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values,
15 and is used to determine drawing colours. See the
16 entry for
\helpref{wxColourDatabase
}{wxcolourdatabase
} for how a pointer to a predefined,
17 named colour may be returned instead of creating a new colour.
19 Valid RGB values are in the range
0 to
255.
21 You can retrieve the current system colour settings with
\helpref{wxSystemSettings
}{wxsystemsettings
}.
23 \wxheading{Derived from
}
25 \helpref{wxObject
}{wxobject
}
27 \wxheading{Include files
}
31 \wxheading{Predefined objects
}
49 \helpref{wxColourDatabase
}{wxcolourdatabase
},
\helpref{wxPen
}{wxpen
},
\helpref{wxBrush
}{wxbrush
},
\rtfsp
50 \helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxSystemSettings
}{wxsystemsettings
}
52 \latexignore{\rtfignore{\wxheading{Members
}}}
55 \membersection{wxColour::wxColour
}\label{wxcolourconstr
}
57 \func{}{wxColour
}{\void}
61 \func{}{wxColour
}{\param{unsigned char
}{ red
},
\param{unsigned char
}{ green
},
\param{unsigned char
}{ blue
}}
63 Constructs a colour from red, green and blue values.
65 \func{}{wxColour
}{\param{const wxString\&
}{colourNname
}}
67 Constructs a colour object using a colour name
68 listed in
{\bf wxTheColourDatabase
}.
70 \func{}{wxColour
}{\param{const wxColour\&
}{ colour
}}
74 \wxheading{Parameters
}
76 \docparam{red
}{The red value.
}
78 \docparam{green
}{The green value.
}
80 \docparam{blue
}{The blue value.
}
82 \docparam{colourName
}{The colour name.
}
84 \docparam{colour
}{The colour to copy.
}
88 \helpref{wxColourDatabase
}{wxcolourdatabase
}
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)
}}{}
99 \membersection{wxColour::Blue
}\label{wxcolourblue
}
101 \constfunc{unsigned char
}{Blue
}{\void}
103 Returns the blue intensity.
106 \membersection{wxColour::GetPixel
}\label{wxcolourgetpixel
}
108 \constfunc{long
}{GetPixel
}{\void}
110 Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
111 On X, an allocated pixel value is returned.
113 -
1 is returned if the pixel is invalid (on X, unallocated).
116 \membersection{wxColour::Green
}\label{wxcolourgreen
}
118 \constfunc{unsigned char
}{Green
}{\void}
120 Returns the green intensity.
123 \membersection{wxColour::Ok
}\label{wxcolourok
}
125 \constfunc{bool
}{Ok
}{\void}
127 Returns
\true if the colour object is valid (the colour has been initialised with RGB values).
130 \membersection{wxColour::Red
}\label{wxcolourred
}
132 \constfunc{unsigned char
}{Red
}{\void}
134 Returns the red intensity.
137 \membersection{wxColour::Set
}\label{wxcolourset
}
139 \func{void
}{Set
}{\param{unsigned char
}{ red
},
\param{unsigned char
}{ green
},
\param{unsigned char
}{ blue
}}
141 Sets the RGB intensity values.
144 \membersection{wxColour::operator $=$
}\label{wxcolourassign
}
146 \func{wxColour\&
}{operator $=$
}{\param{const wxColour\&
}{ colour
}}
148 Assignment operator, taking another colour object.
150 \func{wxColour\&
}{operator $=$
}{\param{const wxString\&
}{ colourName
}}
152 Assignment operator, using a colour name to be found in the colour database.
156 \helpref{wxColourDatabase
}{wxcolourdatabase
}
159 \membersection{wxColour::operator $==$
}\label{wxcolourequality
}
161 \func{bool
}{operator $==$
}{\param{const wxColour\&
}{ colour
}}
163 Tests the equality of two colours by comparing individual red, green blue colours.
166 \membersection{wxColour::operator $!=$
}\label{wxcolourinequality
}
168 \func{bool
}{operator $!=$
}{\param{const wxColour\&
}{ colour
}}
170 Tests the inequality of two colours by comparing individual red, green blue colours.
172 \section{\class{wxColourData
}}\label{wxcolourdata
}
174 This class holds a variety of information related to colour dialogs.
176 \wxheading{Derived from
}
178 \helpref{wxObject
}{wxobject
}
180 \wxheading{Include files
}
186 \helpref{wxColour
}{wxcolour
},
\helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxColourDialog overview
}{wxcolourdialogoverview
}
188 \latexignore{\rtfignore{\wxheading{Members
}}}
191 \membersection{wxColourData::wxColourData
}\label{wxcolourdatactor
}
193 \func{}{wxColourData
}{\void}
195 Constructor. Initializes the custom colours to
{\tt wxNullColour
},
196 the
{\it data colour
} setting
197 to black, and the
{\it choose full
} setting to true.
200 \membersection{wxColourData::
\destruct{wxColourData
}}\label{wxcolourdatadtor
}
202 \func{}{\destruct{wxColourData
}}{\void}
207 \membersection{wxColourData::GetChooseFull
}\label{wxcolourdatagetchoosefull
}
209 \constfunc{bool
}{GetChooseFull
}{\void}
211 Under Windows, determines whether the Windows colour dialog will display the full dialog
212 with custom colour selection controls. Under PalmOS, determines whether colour dialog
213 will display full rgb colour picker or only available palette indexer.
214 Has no meaning under other platforms.
216 The default value is true.
219 \membersection{wxColourData::GetColour
}\label{wxcolourdatagetcolour
}
221 \constfunc{wxColour\&
}{GetColour
}{\void}
223 Gets the current colour associated with the colour dialog.
225 The default colour is black.
228 \membersection{wxColourData::GetCustomColour
}\label{wxcolourdatagetcustomcolour
}
230 \constfunc{wxColour\&
}{GetCustomColour
}{\param{int
}{ i
}}
232 Gets the
{\it i
}th custom colour associated with the colour dialog.
{\it i
} should
233 be an integer between
0 and
15.
235 The default custom colours are invalid colours.
238 \membersection{wxColourData::SetChooseFull
}\label{wxcolourdatasetchoosefull
}
240 \func{void
}{SetChooseFull
}{\param{const bool
}{flag
}}
242 Under Windows, tells the Windows colour dialog to display the full dialog
243 with custom colour selection controls. Under other platforms, has no effect.
245 The default value is true.
248 \membersection{wxColourData::SetColour
}\label{wxcolourdatasetcolour
}
250 \func{void
}{SetColour
}{\param{const wxColour\&
}{ colour
}}
252 Sets the default colour for the colour dialog.
254 The default colour is black.
257 \membersection{wxColourData::SetCustomColour
}\label{wxcolourdatasetcustomcolour
}
259 \func{void
}{SetCustomColour
}{\param{int
}{ i
},
\param{const wxColour\&
}{ colour
}}
261 Sets the
{\it i
}th custom colour for the colour dialog.
{\it i
} should
262 be an integer between
0 and
15.
264 The default custom colours are invalid colours.
267 \membersection{wxColourData::operator $=$
}\label{wxcolourdataassign
}
269 \func{void
}{operator $=$
}{\param{const wxColourData\&
}{ data
}}
271 Assignment operator for the colour data.
276 \section{\class{wxColourDatabase
}}\label{wxcolourdatabase
}
278 wxWidgets maintains a database of standard RGB colours for a predefined
279 set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
280 application may add to this set if desired by using
281 \helpref{AddColour
}{wxcolourdatabaseaddcolour
} and may use it to look up
282 colours by names using
\helpref{Find
}{wxcolourdatabasefind
} or find the names
283 for the standard colour suing
\helpref{FindName
}{wxcolourdatabasefindname
}.
285 There is one predefined instance of this class called
286 {\bf wxTheColourDatabase
}.
288 \wxheading{Derived from
}
292 \wxheading{Include files
}
298 The standard database contains at least the following colours:
300 AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
301 CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
302 ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
303 FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
304 INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
305 MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
306 MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
307 MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
308 NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
309 SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
310 BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
315 \helpref{wxColour
}{wxcolour
}
317 \latexignore{\rtfignore{\wxheading{Members
}}}
320 \membersection{wxColourDatabase::wxColourDatabase
}\label{wxcolourdatabaseconstr
}
322 \func{}{wxColourDatabase
}{\void}
324 Constructs the colour database. It will be initialized at the first use.
327 \membersection{wxColourDatabase::AddColour
}\label{wxcolourdatabaseaddcolour
}
329 \func{void
}{AddColour
}{\param{const wxString\&
}{colourName
},
\param{const wxColour\&
}{colour
}}
331 \func{void
}{AddColour
}{\param{const wxString\&
}{colourName
},
\param{wxColour*
}{colour
}}
333 Adds a colour to the database. If a colour with the same name already exists,
336 Please note that the overload taking a pointer is deprecated and will be
337 removed in the next wxWidgets version, please don't use it.
340 \membersection{wxColourDatabase::Find
}\label{wxcolourdatabasefind
}
342 \func{wxColour
}{Find
}{\param{const wxString\&
}{colourName
}}
344 Finds a colour given the name. Returns an invalid colour object (that is, such
345 that its
\helpref{Ok()
}{wxcolourok
} method returns
\false) if the colour wasn't
346 found in the database.
349 \membersection{wxColourDatabase::FindName
}\label{wxcolourdatabasefindname
}
351 \constfunc{wxString
}{FindName
}{\param{const wxColour\&
}{ colour
}}
353 Finds a colour name given the colour. Returns an empty string if the colour is
354 not found in the database.