A Pure-Python implementation of the colour chooser dialog.
The PyColourChooser is a pure python implementation of the colour chooser dialog. It’s useful for embedding the colour choosing functionality inside other widgets, when the pop-up dialog is undesirable. It can also be used as a drop-in replacement on the GTK platform, as the native dialog is kind of ugly.
__init__ | Creates an instance of the colour chooser. Note that it is best to |
doPaletteClick | Updates the colour values based on the mouse location |
GetValue | Returns a wxColour object indicating the current colour choice. |
InitColours | Initializes the pre-set palette colours. |
onAddCustom | Adds a custom colour to the custom colour box set. Boxes are |
onBasicClick | Highlights the selected colour box and updates the solid colour |
onCustomClick | Highlights the selected custom colour box and updates the solid |
onPaletteDown | Stores state that the mouse has been pressed and updates |
onPaletteMotion | Updates the colour values during mouse motion while the |
onPaletteUp | Stores state that the mouse is no longer depressed. |
onScroll | Updates the solid colour display to reflect the changing slider. |
setCustomColour | Sets the custom colour at the given index. true_colour is wxColour |
SetValue | Updates the colour chooser to reflect the given wxColour. |
UpdateColour | Performs necessary updates for when the colour selection has |
UpdateEntries | Updates the color levels to display the new values. |
A Pure-Python implementation of the colour chooser dialog.
The PyColourChooser is a pure python implementation of the colour chooser dialog. It’s useful for embedding the colour choosing functionality inside other widgets, when the pop-up dialog is undesirable. It can also be used as a drop-in replacement on the GTK platform, as the native dialog is kind of ugly.
Creates an instance of the colour chooser. Note that it is best to accept the given size of the colour chooser as it is currently not resizeable.
Updates the colour values based on the mouse location over the palette.
Returns a wxColour object indicating the current colour choice.
Initializes the pre-set palette colours.
Adds a custom colour to the custom colour box set. Boxes are chosen in a round-robin fashion, eventually overwriting previously added colours.
Highlights the selected colour box and updates the solid colour display and colour slider to reflect the choice.
Highlights the selected custom colour box and updates the solid colour display and colour slider to reflect the choice.
Stores state that the mouse has been pressed and updates the selected colour values.
Updates the colour values during mouse motion while the mouse button is depressed.
Stores state that the mouse is no longer depressed.
Updates the solid colour display to reflect the changing slider.
Sets the custom colour at the given index. true_colour is wxColour object containing the actual rgb value of the custom colour. base_colour (wxColour) and slidepos (int) are used to configure the colour slider and set everything to its original position.
Updates the colour chooser to reflect the given wxColour.
Performs necessary updates for when the colour selection has changed.
Updates the color levels to display the new values.