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
}
20 \helpref{wxColourDatabase
}{wxcolourdatabase
},
\helpref{wxPen
}{wxpen
},
\helpref{wxBrush
}{wxbrush
},
\rtfsp
21 \helpref{wxColourDialog
}{wxcolourdialog
}
23 \latexignore{\rtfignore{\wxheading{Members
}}}
25 \membersection{wxColour::wxColour
}\label{wxcolourconstr
}
27 \func{}{wxColour
}{\void}
31 \func{}{wxColour
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
33 Constructs a colour from red, green and blue values.
35 \func{}{wxColour
}{\param{const wxString\&
}{colourNname
}}
37 Constructs a colour object using a colour name
38 listed in
{\bf wxTheColourDatabase
}.
40 \func{}{wxColour
}{\param{const wxColour\&
}{ colour
}}
44 \wxheading{Parameters
}
46 \docparam{red
}{The red value.
}
48 \docparam{green
}{The green value.
}
50 \docparam{blue
}{The blue value.
}
52 \docparam{colourName
}{The colour name.
}
54 \docparam{colour
}{The colour to copy.
}
58 \helpref{wxColourDatabase
}{wxcolourdatabase
}
60 \pythonnote{Constructors supported by wxPython are:
\par
61 \indented{2cm
}{\begin{twocollist
}
62 \twocolitem{\bf{wxColour(red=
0, green=
0, blue=
0)
}}{}
63 \twocolitem{\bf{wxNamedColour(name)
}}{}
68 \membersection{wxColour::Blue
}\label{wxcolourblue
}
70 \constfunc{unsigned char
}{Blue
}{\void}
72 Returns the blue intensity.
74 \membersection{wxColour::GetPixel
}\label{wxcolourgetpixel
}
76 \constfunc{long
}{GetPixel
}{\void}
78 Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
79 On X, an allocated pixel value is returned.
81 -
1 is returned if the pixel is invalid (on X, unallocated).
83 \membersection{wxColour::Green
}\label{wxcolourgreen
}
85 \constfunc{unsigned char
}{Green
}{\void}
87 Returns the green intensity.
89 \membersection{wxColour::Ok
}\label{wxcolourok
}
91 \constfunc{bool
}{Ok
}{\void}
93 Returns TRUE if the colour object is valid (the colour has been initialised with RGB values).
95 \membersection{wxColour::Red
}\label{wxcolourred
}
97 \constfunc{unsigned char
}{Red
}{\void}
99 Returns the red intensity.
101 \membersection{wxColour::Set
}\label{wxcolourset
}
103 \func{void
}{Set
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
105 Sets the RGB intensity values.
107 \membersection{wxColour::operator $=$
}\label{wxcolourassign
}
109 \func{wxColour\&
}{operator $=$
}{\param{const wxColour\&
}{ colour
}}
111 Assignment operator, taking another colour object.
113 \func{wxColour\&
}{operator $=$
}{\param{const wxString\&
}{ colourName
}}
115 Assignment operator, using a colour name to be found in the colour database.
119 \helpref{wxColourDatabase
}{wxcolourdatabase
}
121 \membersection{wxColour::operator $==$
}\label{wxcolourequality
}
123 \func{bool
}{operator $==$
}{\param{const wxColour\&
}{ colour
}}
125 Tests the equality of two colours by comparing individual red, green blue colours.
127 \membersection{wxColour::operator $!=$
}\label{wxcolourinequality
}
129 \func{bool
}{operator $!=$
}{\param{const wxColour\&
}{ colour
}}
131 Tests the inequality of two colours by comparing individual red, green blue colours.
133 \section{\class{wxColourData
}}\label{wxcolourdata
}
135 This class holds a variety of information related to colour dialogs.
137 \wxheading{Derived from
}
139 \helpref{wxObject
}{wxobject
}
141 \wxheading{Include files
}
147 \helpref{wxColour
}{wxcolour
},
\helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxColourDialog overview
}{wxcolourdialogoverview
}
149 \latexignore{\rtfignore{\wxheading{Members
}}}
151 \membersection{wxColourData::wxColourData
}\label{wxcolourdataconstr
}
153 \func{}{wxColourData
}{\void}
155 Constructor. Initializes the custom colours to white, the
{\it data colour
} setting
156 to black, and the
{\it choose full
} setting to TRUE.
158 \membersection{wxColourData::
\destruct{wxColourData
}}
160 \func{}{\destruct{wxColourData
}}{\void}
164 \membersection{wxColourData::GetChooseFull
}\label{wxcolourdatagetchoosefull
}
166 \constfunc{bool
}{GetChooseFull
}{\void}
168 Under Windows, determines whether the Windows colour dialog will display the full dialog
169 with custom colour selection controls. Has no meaning under other platforms.
171 The default value is TRUE.
173 \membersection{wxColourData::GetColour
}\label{wxcolourdatagetcolour
}
175 \constfunc{wxColour\&
}{GetColour
}{\void}
177 Gets the current colour associated with the colour dialog.
179 The default colour is black.
181 \membersection{wxColourData::GetCustomColour
}\label{wxcolourdatagetcustomcolour
}
183 \constfunc{wxColour\&
}{GetCustomColour
}{\param{int
}{ i
}}
185 Gets the
{\it i
}th custom colour associated with the colour dialog.
{\it i
} should
186 be an integer between
0 and
15.
188 The default custom colours are all white.
190 \membersection{wxColourData::SetChooseFull
}\label{wxcolourdatasetchoosefull
}
192 \func{void
}{SetChooseFull
}{\param{const bool
}{flag
}}
194 Under Windows, tells the Windows colour dialog to display the full dialog
195 with custom colour selection controls. Under other platforms, has no effect.
197 The default value is TRUE.
199 \membersection{wxColourData::SetColour
}\label{wxcolourdatasetcolour
}
201 \func{void
}{SetColour
}{\param{const wxColour\&
}{ colour
}}
203 Sets the default colour for the colour dialog.
205 The default colour is black.
207 \membersection{wxColourData::SetCustomColour
}\label{wxcolourdatasetcustomcolour
}
209 \func{void
}{SetColour
}{\param{int
}{ i
},
\param{const wxColour\&
}{ colour
}}
211 Sets the
{\it i
}th custom colour for the colour dialog.
{\it i
} should
212 be an integer between
0 and
15.
214 The default custom colours are all white.
216 \membersection{wxColourData::operator $=$
}\label{wxcolourdataassign
}
218 \func{void
}{operator $=$
}{\param{const wxColourData\&
}{ data
}}
220 Assingment operator for the colour data.
222 \section{\class{wxColourDatabase
}}\label{wxcolourdatabase
}
224 wxWindows maintains a database of standard RGB colours for a predefined
225 set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
226 application may add to this set if desired by using
{\it Append
}. There
227 is only one instance of this class:
{\bf wxTheColourDatabase
}.
229 \wxheading{Derived from
}
231 \helpref{wxList
}{wxlist
}\\
232 \helpref{wxObject
}{wxobject
}
234 \wxheading{Include files
}
240 The colours in the standard database are as follows:
242 AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
243 CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
244 ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
245 FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
246 INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
247 MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
248 MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
249 MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
250 NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
251 SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
252 BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
257 \helpref{wxColour
}{wxcolour
}
259 \latexignore{\rtfignore{\wxheading{Members
}}}
261 \membersection{wxColourDatabase::wxColourDatabase
}\label{wxcolourdatabaseconstr
}
263 \func{}{wxColourDatabase
}{\void}
265 Constructs the colour database.
267 \membersection{wxColourDatabase::FindColour
}\label{wxcolourdatabasefindcolour
}
269 \func{wxColour*
}{FindColour
}{\param{const wxString\&
}{colourName
}}
271 Finds a colour given the name. Returns NULL if not found.
273 \membersection{wxColourDatabase::FindName
}\label{wxcolourdatabasefindname
}
275 \constfunc{wxString
}{FindName
}{\param{const wxColour\&
}{ colour
}}
277 Finds a colour name given the colour. Returns NULL if not found.
279 \membersection{wxColourDatabase::Initialize
}\label{wxcolourdatabaseinitialize
}
281 \func{void
}{Initialize
}{\void}
283 Initializes the database with a number of stock colours. Called by wxWindows