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 \membersection{wxColour::Blue
}\label{wxcolourblue
}
62 \constfunc{unsigned char
}{Blue
}{\void}
64 Returns the blue intensity.
66 \membersection{wxColour::GetPixel
}\label{wxcolourgetpixel
}
68 \constfunc{long
}{GetPixel
}{\void}
70 Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
71 On X, an allocated pixel value is returned.
73 -
1 is returned if the pixel is invalid (on X, unallocated).
75 \membersection{wxColour::Green
}\label{wxcolourgreen
}
77 \constfunc{unsigned char
}{Green
}{\void}
79 Returns the green intensity.
81 \membersection{wxColour::Ok
}\label{wxcolourok
}
83 \constfunc{bool
}{Ok
}{\void}
85 Returns TRUE if the colour object is valid (the colour has been initialised with RGB values).
87 \membersection{wxColour::Red
}\label{wxcolourred
}
89 \constfunc{unsigned char
}{Red
}{\void}
91 Returns the red intensity.
93 \membersection{wxColour::Set
}\label{wxcolourset
}
95 \func{void
}{Set
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
97 Sets the RGB intensity values.
99 \membersection{wxColour::operator $=$
}\label{wxcolourassign
}
101 \func{wxColour\&
}{operator $=$
}{\param{const wxColour\&
}{ colour
}}
103 Assignment operator, taking another colour object.
105 \func{wxColour\&
}{operator $=$
}{\param{const wxString\&
}{ colourName
}}
107 Assignment operator, using a colour name to be found in the colour database.
111 \helpref{wxColourDatabase
}{wxcolourdatabase
}
113 \membersection{wxColour::operator $==$
}\label{wxcolourequality
}
115 \func{bool
}{operator $==$
}{\param{const wxColour\&
}{ colour
}}
117 Tests the equality of two colours by comparing individual red, green blue colours.
119 \membersection{wxColour::operator $!=$
}\label{wxcolourinequality
}
121 \func{bool
}{operator $!=$
}{\param{const wxColour\&
}{ colour
}}
123 Tests the inequality of two colours by comparing individual red, green blue colours.
125 \section{\class{wxColourData
}}\label{wxcolourdata
}
127 This class holds a variety of information related to colour dialogs.
129 \wxheading{Derived from
}
131 \helpref{wxObject
}{wxobject
}
133 \wxheading{Include files
}
139 \helpref{wxColour
}{wxcolour
},
\helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxColourDialog overview
}{wxcolourdialogoverview
}
141 \latexignore{\rtfignore{\wxheading{Members
}}}
143 \membersection{wxColourData::wxColourData
}\label{wxcolourdataconstr
}
145 \func{}{wxColourData
}{\void}
147 Constructor. Initializes the custom colours to white, the
{\it data colour
} setting
148 to black, and the
{\it choose full
} setting to TRUE.
150 \membersection{wxColourData::
\destruct{wxColourData
}}
152 \func{}{\destruct{wxColourData
}}{\void}
156 \membersection{wxColourData::GetChooseFull
}\label{wxcolourdatagetchoosefull
}
158 \constfunc{bool
}{GetChooseFull
}{\void}
160 Under Windows, determines whether the Windows colour dialog will display the full dialog
161 with custom colour selection controls. Has no meaning under other platforms.
163 The default value is TRUE.
165 \membersection{wxColourData::GetColour
}\label{wxcolourdatagetcolour
}
167 \constfunc{wxColour\&
}{GetColour
}{\void}
169 Gets the current colour associated with the colour dialog.
171 The default colour is black.
173 \membersection{wxColourData::GetCustomColour
}\label{wxcolourdatagetcustomcolour
}
175 \constfunc{wxColour\&
}{GetCustomColour
}{\param{int
}{ i
}}
177 Gets the
{\it i
}th custom colour associated with the colour dialog.
{\it i
} should
178 be an integer between
0 and
15.
180 The default custom colours are all white.
182 \membersection{wxColourData::SetChooseFull
}\label{wxcolourdatasetchoosefull
}
184 \func{void
}{SetChooseFull
}{\param{const bool
}{flag
}}
186 Under Windows, tells the Windows colour dialog to display the full dialog
187 with custom colour selection controls. Under other platforms, has no effect.
189 The default value is TRUE.
191 \membersection{wxColourData::SetColour
}\label{wxcolourdatasetcolour
}
193 \func{void
}{SetColour
}{\param{const wxColour\&
}{ colour
}}
195 Sets the default colour for the colour dialog.
197 The default colour is black.
199 \membersection{wxColourData::SetCustomColour
}\label{wxcolourdatasetcustomcolour
}
201 \func{void
}{SetColour
}{\param{int
}{ i
},
\param{const wxColour\&
}{ colour
}}
203 Sets the
{\it i
}th custom colour for 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::operator $=$
}\label{wxcolourdataassign
}
210 \func{void
}{operator $=$
}{\param{const wxColourData\&
}{ data
}}
212 Assingment operator for the colour data.
214 \section{\class{wxColourDatabase
}}\label{wxcolourdatabase
}
216 wxWindows maintains a database of standard RGB colours for a predefined
217 set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
218 application may add to this set if desired by using
{\it Append
}. There
219 is only one instance of this class:
{\bf wxTheColourDatabase
}.
221 \wxheading{Derived from
}
223 \helpref{wxList
}{wxlist
}\\
224 \helpref{wxObject
}{wxobject
}
226 \wxheading{Include files
}
232 The colours in the standard database are as follows:
234 AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
235 CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
236 ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
237 FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
238 INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
239 MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
240 MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
241 MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
242 NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
243 SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
244 BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
249 \helpref{wxColour
}{wxcolour
}
251 \latexignore{\rtfignore{\wxheading{Members
}}}
253 \membersection{wxColourDatabase::wxColourDatabase
}\label{wxcolourdatabaseconstr
}
255 \func{}{wxColourDatabase
}{\void}
257 Constructs the colour database.
259 \membersection{wxColourDatabase::FindColour
}\label{wxcolourdatabasefindcolour
}
261 \func{wxColour*
}{FindColour
}{\param{const wxString\&
}{colourName
}}
263 Finds a colour given the name. Returns NULL if not found.
265 \membersection{wxColourDatabase::FindName
}\label{wxcolourdatabasefindname
}
267 \constfunc{wxString
}{FindName
}{\param{const wxColour\&
}{ colour
}}
269 Finds a colour name given the colour. Returns NULL if not found.
271 \membersection{wxColourDatabase::Initialize
}\label{wxcolourdatabaseinitialize
}
273 \func{void
}{Initialize
}{\void}
275 Initializes the database with a number of stock colours. Called by wxWindows