wx.ColourDatabase¶
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
Class Hierarchy¶
Methods Summary¶
Constructs the colour database. |
|
Adds a colour to the database. |
|
Finds a colour given the name. |
|
Finds a colour name given the colour. |
Class API¶
- class wx.ColourDatabase(object)¶
Possible constructors:
ColourDatabase() -> None
wxWidgets maintains a database of standard
RGB
colours for a predefined set of named colours.
Methods¶
- __init__(self)¶
Constructs the colour database.
It will be initialized at the first use.
- Return type:
None
- AddColour(self, colourName, colour)¶
Adds a colour to the database.
If a colour with the same name already exists, it is replaced.
- Parameters:
colourName (string)
colour (wx.Colour)
- Return type:
None
- Find(self, colourName)¶
Finds a colour given the name.
Returns an invalid colour object (that is,
wx.Colour.IsOk
will returnFalse
) if the colour wasn’t found in the database.- Parameters:
colourName (string)
- Return type:
- FindColour(self, colour)¶