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