1 \section{\class{wxColour
}}\label{wxcolour
}
3 A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values,
4 and is used to determine drawing colours. See the
5 entry for
\helpref{wxColourDatabase
}{wxcolourdatabase
} for how a pointer to a predefined,
6 named colour may be returned instead of creating a new colour.
8 Valid RGB values are in the range
0 to
255.
10 You can retrieve the current system colour settings with
\helpref{wxSystemSettings
}{wxsystemsettings
}.
12 \wxheading{Derived from
}
14 \helpref{wxObject
}{wxobject
}
16 \wxheading{Include files
}
20 \wxheading{Predefined objects
}
38 \helpref{wxColourDatabase
}{wxcolourdatabase
},
\helpref{wxPen
}{wxpen
},
\helpref{wxBrush
}{wxbrush
},
\rtfsp
39 \helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxSystemSettings
}{wxsystemsettings
}
41 \latexignore{\rtfignore{\wxheading{Members
}}}
43 \membersection{wxColour::wxColour
}\label{wxcolourconstr
}
45 \func{}{wxColour
}{\void}
49 \func{}{wxColour
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
51 Constructs a colour from red, green and blue values.
53 \func{}{wxColour
}{\param{const wxString\&
}{colourNname
}}
55 Constructs a colour object using a colour name
56 listed in
{\bf wxTheColourDatabase
}.
58 \func{}{wxColour
}{\param{const wxColour\&
}{ colour
}}
62 \wxheading{Parameters
}
64 \docparam{red
}{The red value.
}
66 \docparam{green
}{The green value.
}
68 \docparam{blue
}{The blue value.
}
70 \docparam{colourName
}{The colour name.
}
72 \docparam{colour
}{The colour to copy.
}
76 \helpref{wxColourDatabase
}{wxcolourdatabase
}
78 \pythonnote{Constructors supported by wxPython are:
\par
79 \indented{2cm
}{\begin{twocollist
}
80 \twocolitem{{\bf wxColour(red=
0, green=
0, blue=
0)
}}{}
81 \twocolitem{{\bf wxNamedColour(name)
}}{}
86 \membersection{wxColour::Blue
}\label{wxcolourblue
}
88 \constfunc{unsigned char
}{Blue
}{\void}
90 Returns the blue intensity.
92 \membersection{wxColour::GetPixel
}\label{wxcolourgetpixel
}
94 \constfunc{long
}{GetPixel
}{\void}
96 Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
97 On X, an allocated pixel value is returned.
99 -
1 is returned if the pixel is invalid (on X, unallocated).
101 \membersection{wxColour::Green
}\label{wxcolourgreen
}
103 \constfunc{unsigned char
}{Green
}{\void}
105 Returns the green intensity.
107 \membersection{wxColour::Ok
}\label{wxcolourok
}
109 \constfunc{bool
}{Ok
}{\void}
111 Returns true if the colour object is valid (the colour has been initialised with RGB values).
113 \membersection{wxColour::Red
}\label{wxcolourred
}
115 \constfunc{unsigned char
}{Red
}{\void}
117 Returns the red intensity.
119 \membersection{wxColour::Set
}\label{wxcolourset
}
121 \func{void
}{Set
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
123 Sets the RGB intensity values.
125 \membersection{wxColour::operator $=$
}\label{wxcolourassign
}
127 \func{wxColour\&
}{operator $=$
}{\param{const wxColour\&
}{ colour
}}
129 Assignment operator, taking another colour object.
131 \func{wxColour\&
}{operator $=$
}{\param{const wxString\&
}{ colourName
}}
133 Assignment operator, using a colour name to be found in the colour database.
137 \helpref{wxColourDatabase
}{wxcolourdatabase
}
139 \membersection{wxColour::operator $==$
}\label{wxcolourequality
}
141 \func{bool
}{operator $==$
}{\param{const wxColour\&
}{ colour
}}
143 Tests the equality of two colours by comparing individual red, green blue colours.
145 \membersection{wxColour::operator $!=$
}\label{wxcolourinequality
}
147 \func{bool
}{operator $!=$
}{\param{const wxColour\&
}{ colour
}}
149 Tests the inequality of two colours by comparing individual red, green blue colours.
151 \section{\class{wxColourData
}}\label{wxcolourdata
}
153 This class holds a variety of information related to colour dialogs.
155 \wxheading{Derived from
}
157 \helpref{wxObject
}{wxobject
}
159 \wxheading{Include files
}
165 \helpref{wxColour
}{wxcolour
},
\helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxColourDialog overview
}{wxcolourdialogoverview
}
167 \latexignore{\rtfignore{\wxheading{Members
}}}
169 \membersection{wxColourData::wxColourData
}\label{wxcolourdataconstr
}
171 \func{}{wxColourData
}{\void}
173 Constructor. Initializes the custom colours to white, the
{\it data colour
} setting
174 to black, and the
{\it choose full
} setting to true.
176 \membersection{wxColourData::
\destruct{wxColourData
}}
178 \func{}{\destruct{wxColourData
}}{\void}
182 \membersection{wxColourData::GetChooseFull
}\label{wxcolourdatagetchoosefull
}
184 \constfunc{bool
}{GetChooseFull
}{\void}
186 Under Windows, determines whether the Windows colour dialog will display the full dialog
187 with custom colour selection controls. Has no meaning under other platforms.
189 The default value is true.
191 \membersection{wxColourData::GetColour
}\label{wxcolourdatagetcolour
}
193 \constfunc{wxColour\&
}{GetColour
}{\void}
195 Gets the current colour associated with the colour dialog.
197 The default colour is black.
199 \membersection{wxColourData::GetCustomColour
}\label{wxcolourdatagetcustomcolour
}
201 \constfunc{wxColour\&
}{GetCustomColour
}{\param{int
}{ i
}}
203 Gets the
{\it i
}th custom colour associated with the colour dialog.
{\it i
} should
204 be an integer between
0 and
15.
206 The default custom colours are all white.
208 \membersection{wxColourData::SetChooseFull
}\label{wxcolourdatasetchoosefull
}
210 \func{void
}{SetChooseFull
}{\param{const bool
}{flag
}}
212 Under Windows, tells the Windows colour dialog to display the full dialog
213 with custom colour selection controls. Under other platforms, has no effect.
215 The default value is true.
217 \membersection{wxColourData::SetColour
}\label{wxcolourdatasetcolour
}
219 \func{void
}{SetColour
}{\param{const wxColour\&
}{ colour
}}
221 Sets the default colour for the colour dialog.
223 The default colour is black.
225 \membersection{wxColourData::SetCustomColour
}\label{wxcolourdatasetcustomcolour
}
227 \func{void
}{SetCustomColour
}{\param{int
}{ i
},
\param{const wxColour\&
}{ colour
}}
229 Sets the
{\it i
}th custom colour for the colour dialog.
{\it i
} should
230 be an integer between
0 and
15.
232 The default custom colours are all white.
234 \membersection{wxColourData::operator $=$
}\label{wxcolourdataassign
}
236 \func{void
}{operator $=$
}{\param{const wxColourData\&
}{ data
}}
238 Assignment operator for the colour data.
240 \section{\class{wxColourDatabase
}}\label{wxcolourdatabase
}
242 wxWindows maintains a database of standard RGB colours for a predefined
243 set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
244 application may add to this set if desired by using
{\it Append
}. There
245 is only one instance of this class:
{\bf wxTheColourDatabase
}.
247 \wxheading{Derived from
}
249 \helpref{wxList
}{wxlist
}\\
250 \helpref{wxObject
}{wxobject
}
252 \wxheading{Include files
}
258 The colours in the standard database are as follows:
260 AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
261 CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
262 ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
263 FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
264 INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
265 MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
266 MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
267 MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
268 NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
269 SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
270 BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
275 \helpref{wxColour
}{wxcolour
}
277 \latexignore{\rtfignore{\wxheading{Members
}}}
279 \membersection{wxColourDatabase::wxColourDatabase
}\label{wxcolourdatabaseconstr
}
281 \func{}{wxColourDatabase
}{\void}
283 Constructs the colour database.
285 \membersection{wxColourDatabase::FindColour
}\label{wxcolourdatabasefindcolour
}
287 \func{wxColour*
}{FindColour
}{\param{const wxString\&
}{colourName
}}
289 Finds a colour given the name. Returns NULL if not found.
291 \membersection{wxColourDatabase::FindName
}\label{wxcolourdatabasefindname
}
293 \constfunc{wxString
}{FindName
}{\param{const wxColour\&
}{ colour
}}
295 Finds a colour name given the colour. Returns NULL if not found.
297 \membersection{wxColourDatabase::Initialize
}\label{wxcolourdatabaseinitialize
}
299 \func{void
}{Initialize
}{\void}
301 Initializes the database with a number of stock colours. Called by wxWindows