diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py index 0ab91188d2..e0fee046bd 100644 --- a/pyqtgraph/opengl/GLViewWidget.py +++ b/pyqtgraph/opengl/GLViewWidget.py @@ -72,9 +72,9 @@ def initializeGL(self): def setBackgroundColor(self, *args, **kwds): """ Set the background color of the widget. Accepts the same arguments as - pg.mkColor(). + pg.mkColor() and pg.glColor(). """ - self.opts['bgcolor'] = fn.mkColor(*args, **kwds) + self.opts['bgcolor'] = fn.glColor(*args, **kwds) self.update() def getViewport(self): @@ -174,7 +174,7 @@ def paintGL(self, region=None, viewport=None, useItemNames=False): self.setProjection(region=region) self.setModelview() bgcolor = self.opts['bgcolor'] - glClearColor(bgcolor.red(), bgcolor.green(), bgcolor.blue(), 1.0) + glClearColor(*bgcolor) glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ) self.drawItemTree(useItemNames=useItemNames)