Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 695e8dd

Browse files
committed
Default to black if entered color is invalid
1 parent f7bee43 commit 695e8dd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/backends/qt4_editor/formlayout.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ def __init__(self, color, parent=None):
142142

143143
def update_color(self, color):
144144
qcolor = to_qcolor(color)
145-
if color.isValid():
146-
self.colorbtn.color = qcolor
145+
self.colorbtn.color = qcolor # defaults to black if not qcolor.isValid()
147146

148147
def update_text(self, color):
149148
self.lineedit.setText(color.name())

0 commit comments

Comments
 (0)