From 9ea38a1270c0e9ac4d425b818fb72b4efff111ec Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Wed, 22 Jul 2015 13:13:26 -0700 Subject: [PATCH] Use glColor instead of mkColor to set GLViewWidget background color. --- pyqtgraph/opengl/GLViewWidget.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py index 0ab91188..e0fee046 100644 --- a/pyqtgraph/opengl/GLViewWidget.py +++ b/pyqtgraph/opengl/GLViewWidget.py @@ -72,9 +72,9 @@ class GLViewWidget(QtOpenGL.QGLWidget): 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 @@ class GLViewWidget(QtOpenGL.QGLWidget): 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)