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 wx.TheColourDatabase .
The standard database contains at least the following colours:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See also
Constructs the colour database. |
|
Adds a colour to the database. |
|
Finds a colour given the name. |
|
Finds a colour name given the colour. |
wx.
ColourDatabase
(object)¶Possible constructors:
ColourDatabase()
wxWidgets maintains a database of standard RGB
colours for a
predefined set of named colours.
__init__
(self)¶Constructs the colour database.
It will be initialized at the first use.
AddColour
(self, colourName, colour)¶Adds a colour to the database.
If a colour with the same name already exists, it is replaced.
colourName (string) –
colour (wx.Colour) –
Find
(self, colourName)¶Finds a colour given the name.
Returns an invalid colour object (that is, wx.Colour.IsOk
will return False
) if the colour wasn’t found in the database.
colourName (string) –
FindColour
(self, colour)¶