8000 remove _orig_color which is duplicate of _rgb · matplotlib/matplotlib@c22584e · GitHub
[go: up one dir, main page]

Skip to content

Commit c22584e

Browse files
committed
remove _orig_color which is duplicate of _rgb
1 parent 38d69b0 commit c22584e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,6 @@ def __init__(self):
783783
self._linestyle = 'solid'
784784
self._linewidth = 1
785785
self._rgb = (0.0, 0.0, 0.0, 1.0)
786-
self._orig_color = (0.0, 0.0, 0.0, 1.0)
787786
self._hatch = None
788787
self._url = None
789788
self._gid = None
@@ -803,7 +802,6 @@ def copy_properties(self, gc):
803802
self._linestyle = gc._linestyle
804803
self._linewidth = gc._linewidth
805804
self._rgb = gc._rgb
806-
self._orig_color = gc._orig_color
807805
self._hatch = gc._hatch
808806
self._url = gc._url
809807
self._gid = gc._gid
@@ -937,7 +935,7 @@ def set_alpha(self, alpha):
937935
else:
938936
self._alpha = 1.0
939937
self._forced_alpha = False
940-
self.set_foreground(self._orig_color)
938+
self.set_foreground(self._rgb, isRGBA=True)
941939

942940
def set_antialiased(self, b):
943941
"""
@@ -999,8 +997,9 @@ def set_foreground(self, fg, isRGBA=False):
999997
1000998
If you know fg is rgba, set ``isRGBA=True`` for efficiency.
1001999
"""
1002-
self._orig_color = fg
1003-
if self._forced_alpha:
1000+
if self._forced_alpha and isRGBA:
1001+
self._rgb = fg[:3] + (self._alpha,)
1002+
elif self._forced_alpha:
10041003
self._rgb = colors.colorConverter.to_rgba(fg, self._alpha)
10051004
elif isRGBA:
10061005
self._rgb = fg
@@ -1011,7 +1010,6 @@ def set_graylevel(self, frac):
10111010
"""
10121011
Set the foreground color to be a gray level with *frac*
10131012
"""
1014-
self._orig_color = frac
10151013
self._rgb = (frac, frac, frac, self._alpha)
10161014

10171015
def set_joinstyle(self, js):

0 commit comments

Comments
 (0)
0