1717from .plot import QwtPlot , QwtPlotItem
1818from .text import QwtText
1919from ._math import qwtFuzzyGreaterOrEqual , qwtFuzzyLessOrEqual
20+ from .qthelpers import qcolor_from_str
2021
2122from .qt .QtGui import QPen
2223from .qt .QtCore import Qt
@@ -79,13 +80,13 @@ def make(
7980 :param enableminor: Tuple of two boolean values (x, y) for enabling minor grid lines
8081 :type enableminor: bool or None
8182 :param color: Pen color for both major and minor grid lines (default: Qt.gray)
82- :type color: QColor or None
83+ :type color: QColor or str or None
8384 :param width: Pen width for both major and minor grid lines (default: 1.0)
8485 :type width: float or None
8586 :param style: Pen style for both major and minor grid lines (default: Qt.DotLine)
8687 :type style: Qt.PenStyle or None
8788 :param mincolor: Pen color for minor grid lines only (default: Qt.gray)
88- :type mincolor: QColor or None
89+ :type mincolor: QColor or str or None
8990 :param minwidth: Pen width for minor grid lines only (default: 1.0)
9091 :type minwidth: float or None
9192 :param minstyle: Pen style for minor grid lines only (default: Qt.DotLine)
@@ -98,12 +99,12 @@ def make(
9899 item = cls ()
99100 if z is not None :
100101 item .setZ (z )
101- color = Qt .gray if color is None else color
102+ color = qcolor_from_str ( color , Qt .gray )
102103 width = 1.0 if width is None else width
103104 style = Qt .DotLine if style is None else style
104105 item .setPen (QPen (color , width , style ))
105106 if mincolor is not None or minwidth is not None or minstyle is not None :
106- mincolor = Qt .gray if mincolor is None else mincolor
107+ mincolor = qcolor_from_str ( mincolor , Qt .gray )
107108 minwidth = 1.0 if width is None else minwidth
108109 minstyle = Qt .DotLine if style is None else minstyle
109110 item .setMinorPen (QPen (mincolor , minwidth , minstyle ))
0 commit comments