diff --git a/pyqtgraph/graphicsItems/TextItem.py b/pyqtgraph/graphicsItems/TextItem.py index dc240929..96e07456 100644 --- a/pyqtgraph/graphicsItems/TextItem.py +++ b/pyqtgraph/graphicsItems/TextItem.py @@ -50,6 +50,7 @@ class TextItem(GraphicsObject): self._lastTransform = None self._bounds = QtCore.QRectF() if html is None: + self.color = color self.setText(text, color) else: self.setHtml(html) @@ -63,6 +64,8 @@ class TextItem(GraphicsObject): This method sets the plain text of the item; see also setHtml(). """ + if color != self.color: + color = self.color color = fn.mkColor(color) self.textItem.setDefaultTextColor(color) self.textItem.setPlainText(text) @@ -182,4 +185,4 @@ class TextItem(GraphicsObject): self.updateTextPos() - \ No newline at end of file +