pyqt5 qpalette code example Example: how to import qpalette pyqt5 from PyQt5.QtGui import QPalette # You maybe want to import QColor also.