#include <wx/gdicmn.h>
wxWidgets maintains a database of standard RGB colours for a predefined set of named colours.
The application may add to this set if desired by using AddColour() and may use it to look up colours by names using Find() or find the names for the standard colour using FindName().
There is one predefined, global instance of this class called wxTheColourDatabase.
The standard database contains at least the following colours:
AQUAMARINE | FIREBRICK | MEDIUM FOREST GREEN | RED |
Public Member Functions | |
wxColourDatabase () | |
Constructs the colour database. | |
void | AddColour (const wxString &colourName, const wxColour &colour) |
Adds a colour to the database. | |
wxColour | Find (const wxString &colourName) const |
Finds a colour given the name. | |
wxString | FindName (const wxColour &colour) const |
Finds a colour name given the colour. |
wxColourDatabase::wxColourDatabase | ( | ) |
Constructs the colour database.
It will be initialized at the first use.
Adds a colour to the database.
If a colour with the same name already exists, it is replaced.
Finds a colour given the name.
Returns an invalid colour object (that is, wxColour::IsOk() will return false) if the colour wasn't found in the database.
![]() |
[ top ] |