Aug-09-2019, 06:49 AM
Hi,
I am creating an application with PyQt5. I originally was using an image for the background of my program that has the correct gradient however recently wanted to make the interface dynamic/re-sizable.
To create and set the gradient, in the main window, I am using:
I am creating an application with PyQt5. I originally was using an image for the background of my program that has the correct gradient however recently wanted to make the interface dynamic/re-sizable.
To create and set the gradient, in the main window, I am using:
p = QPalette() gradient = QLinearGradient(0, 0, 300, 400) gradient.setColorAt(1.0, QColor(26, 29, 32)) gradient.setColorAt(0.0, QColor(39, 44, 49)) p.setBrush(QPalette.Window, QBrush(gradient)) self.setPalette(p)The gradient however has banding between colours, it's not massively obvious in this picture but definitely present. I imagine it has something to do with colour depth but am unsure how to fix the issue.
![[Image: 2mriaAr.png]](https://i.imgur.com/2mriaAr.png)