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
}
16 \helpref{wxColourDatabase
}{wxcolourdatabase
},
\helpref{wxPen
}{wxpen
},
\helpref{wxBrush
}{wxbrush
},
\rtfsp
17 \helpref{wxColourDialog
}{wxcolourdialog
}
19 \latexignore{\rtfignore{\wxheading{Members
}}}
21 \membersection{wxColour::wxColour
}\label{wxcolourconstr
}
23 \func{}{wxColour
}{\void}
27 \func{}{wxColour
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
29 Constructs a colour from red, green and blue values.
31 \func{}{wxColour
}{\param{const wxString\&
}{colourNname
}}
33 Constructs a colour object using a colour name
34 listed in
{\bf wxTheColourDatabase
}.
36 \wxheading{Parameters
}
38 \docparam{red
}{The red value.
}
40 \docparam{green
}{The green value.
}
42 \docparam{blue
}{The blue value.
}
44 \docparam{colourName
}{The colour name.
}
48 \helpref{wxColourDatabase
}{wxcolourdatabase
}
50 \membersection{wxColour::Blue
}\label{wxcolourblue
}
52 \constfunc{unsigned char
}{Blue
}{\void}
54 Returns the blue intensity.
56 \membersection{wxColour::GetPixel
}\label{wxcolourgetpixel
}
58 \constfunc{long
}{GetPixel
}{\void}
60 Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
61 On X, an allocated pixel value is returned.
63 -
1 is returned if the pixel is invalid (on X, unallocated).
65 \membersection{wxColour::Green
}\label{wxcolourgreen
}
67 \constfunc{unsigned char
}{Green
}{\void}
69 Returns the green intensity.
71 \membersection{wxColour::Ok
}\label{wxcolourok
}
73 \constfunc{bool
}{Ok
}{\void}
75 Returns TRUE if the colour object is valid (the colour has been initialised with RGB values).
77 \membersection{wxColour::Red
}\label{wxcolourred
}
79 \constfunc{unsigned char
}{Red
}{\void}
81 Returns the red intensity.
83 \membersection{wxColour::Set
}\label{wxcolourset
}
85 \func{void
}{Set
}{\param{const unsigned char
}{ red
},
\param{const unsigned char
}{ green
},
\param{const unsigned char
}{ blue
}}
87 Sets the RGB intensity values.
89 \membersection{wxColour::operator $=$
}\label{wxcolourassign
}
91 \func{wxColour\&
}{operator $=$
}{\param{const wxColour\&
}{ colour
}}
93 Assignment operator, taking another colour object.
95 \func{wxColour\&
}{operator $=$
}{\param{const wxString\&
}{ colourName
}}
97 Assignment operator, using a colour name to be found in the colour database.
101 \helpref{wxColourDatabase
}{wxcolourdatabase
}
103 \membersection{wxColour::operator $==$
}\label{wxcolourequality
}
105 \func{bool
}{operator $==$
}{\param{const wxColour\&
}{ colour
}}
107 Tests the equality of two colours by comparing individual red, green blue colours.
109 TODO: this may be different on platforms other than Windows - no reference counting
112 \membersection{wxColour::operator $!=$
}\label{wxcolourinequality
}
114 \func{bool
}{operator $!=$
}{\param{const wxColour\&
}{ colour
}}
116 Tests the inequality of two colours by comparing individual red, green blue colours.
118 TODO: this may be different on platforms other than Windows - no reference counting
121 \section{\class{wxColourData
}}\label{wxcolourdata
}
123 This class holds a variety of information related to colour dialogs.
125 \wxheading{Derived from
}
127 \helpref{wxObject
}{wxobject
}
131 \helpref{wxColour
}{wxcolour
},
\helpref{wxColourDialog
}{wxcolourdialog
},
\helpref{wxColourDialog overview
}{wxcolourdialogoverview
}
133 \latexignore{\rtfignore{\wxheading{Members
}}}
135 \membersection{wxColourData::wxColourData
}\label{wxcolourdataconstr
}
137 \func{}{wxColourData
}{\void}
139 Constructor. Initializes the custom colours to white, the
{\it data colour
} setting
140 to black, and the
{\it choose full
} setting to TRUE.
142 \membersection{wxColourData::
\destruct{wxColourData
}}
144 \func{}{\destruct{wxColourData
}}{\void}
148 \membersection{wxColourData::GetChooseFull
}\label{wxcolourdatagetchoosefull
}
150 \constfunc{bool
}{GetChooseFull
}{\void}
152 Under Windows, determines whether the Windows colour dialog will display the full dialog
153 with custom colour selection controls. Has no meaning under other platforms.
155 The default value is TRUE.
157 \membersection{wxColourData::GetColour
}\label{wxcolourdatagetcolour
}
159 \constfunc{wxColour\&
}{GetColour
}{\void}
161 Gets the current colour associated with the colour dialog.
163 The default colour is black.
165 \membersection{wxColourData::GetCustomColour
}\label{wxcolourdatagetcustomcolour
}
167 \constfunc{wxColour\&
}{GetCustomColour
}{\param{int
}{ i
}}
169 Gets the
{\it i
}th custom colour associated with the colour dialog.
{\it i
} should
170 be an integer between
0 and
15.
172 The default custom colours are all white.
174 \membersection{wxColourData::SetChooseFull
}\label{wxcolourdatasetchoosefull
}
176 \func{void
}{SetChooseFull
}{\param{const bool
}{flag
}}
178 Under Windows, tells the Windows colour dialog to display the full dialog
179 with custom colour selection controls. Under other platforms, has no effect.
181 The default value is TRUE.
183 \membersection{wxColourData::SetColour
}\label{wxcolourdatasetcolour
}
185 \func{void
}{SetColour
}{\param{const wxColour\&
}{ colour
}}
187 Sets the default colour for the colour dialog.
189 The default colour is black.
191 \membersection{wxColourData::SetCustomColour
}\label{wxcolourdatasetcustomcolour
}
193 \func{void
}{SetColour
}{\param{int
}{ i
},
\param{const wxColour\&
}{ colour
}}
195 Sets the
{\it i
}th custom colour for the colour dialog.
{\it i
} should
196 be an integer between
0 and
15.
198 The default custom colours are all white.
200 \membersection{wxColourData::operator $=$
}\label{wxcolourdataassign
}
202 \func{void
}{operator $=$
}{\param{const wxColourData\&
}{ data
}}
204 Assingment operator for the colour data.
206 \section{\class{wxColourDatabase
}}\label{wxcolourdatabase
}
208 wxWindows maintains a database of standard RGB colours for a predefined
209 set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
210 application may add to this set if desired by using
{\it Append
}. There
211 is only one instance of this class:
{\bf wxTheColourDatabase
}.
213 \wxheading{Derived from
}
215 \helpref{wxList
}{wxlist
}\\
216 \helpref{wxObject
}{wxobject
}
220 The colours in the standard database are as follows:
222 AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
223 CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
224 ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
225 FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
226 INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
227 MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
228 MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
229 MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
230 NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
231 SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
232 BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
237 \helpref{wxColour
}{wxcolour
}
239 \latexignore{\rtfignore{\wxheading{Members
}}}
241 \membersection{wxColourDatabase::wxColourDatabase
}\label{wxcolourdatabaseconstr
}
243 \func{}{wxColourDatabase
}{\void}
245 Constructs the colour database.
247 \membersection{wxColourDatabase::FindColour
}\label{wxcolourdatabasefindcolour
}
249 \func{wxColour*
}{FindColour
}{\param{const wxString\&
}{colourName
}}
251 Finds a colour given the name. Returns NULL if not found.
253 \membersection{wxColourDatabase::FindName
}\label{wxcolourdatabasefindname
}
255 \constfunc{wxString
}{FindName
}{\param{const wxColour\&
}{ colour
}}
257 Finds a colour name given the colour. Returns NULL if not found.
259 \membersection{wxColourDatabase::Initialize
}\label{wxcolourdatabaseinitialize
}
261 \func{void
}{Initialize
}{\void}
263 Initializes the database with a number of stock colours. Called by wxWindows