Below is a short snippet to implement a color-picker attached to a button in Qt. Clicking on the button pops up a dialog (native) to select a color. The color is shown by the color of the button face. A right-click option is included to allow clearing of the color setting (returning the value to None).
This is a companion discussion topic for the original entry at https://www.pymadethis.com/article/qcolorbutton-a-color-selector-tool-for-pyqt/