CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
ColorButton.py27 linesDownload Raw Back to examples
1"""2Simple example demonstrating a button which displays a colored rectangle3and allows the user to select a new color by clicking on the button.4"""5 6 7import pyqtgraph as pg8from pyqtgraph.Qt import QtWidgets9 10app = pg.mkQApp("ColorButton Example")11win = QtWidgets.QMainWindow()12btn = pg.ColorButton()13win.setCentralWidget(btn)14win.show()15win.setWindowTitle('pyqtgraph example: ColorButton')16 17def change(btn):18    print("change", btn.color())19def done(btn):20    print("done", btn.color())21 22btn.sigColorChanging.connect(change)23btn.sigColorChanged.connect(done)24 25if __name__ == '__main__':26    pg.exec()27 
Aluode/PerceptionLabPortable · CoolFace