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

Skip to content

remove _orig_color which is duplicate of _rgb #3683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,6 @@ def __init__(self):
self._linestyle = 'solid'
self._linewidth = 1
self._rgb = (0.0, 0.0, 0.0, 1.0)
self._orig_color = (0.0, 0.0, 0.0, 1.0)
self._hatch = None
self._url = None
self._gid = None
Expand All @@ -803,7 +802,6 @@ def copy_properties(self, gc):
self._linestyle = gc._linestyle
self._linewidth = gc._linewidth
self._rgb = gc._rgb
self._orig_color = gc._orig_color
self._hatch = gc._hatch
self._url = gc._url
self._gid = gc._gid
Expand Down Expand Up @@ -937,7 +935,7 @@ def set_alpha(self, alpha):
else:
self._alpha = 1.0
self._forced_alpha = False
self.set_foreground(self._orig_color)
self.set_foreground(self._rgb, isRGBA=True)

def set_antialiased(self, b):
"""
Expand Down Expand Up @@ -999,8 +997,9 @@ def set_foreground(self, fg, isRGBA=False):

If you know fg is rgba, set ``isRGBA=True`` for efficiency.
"""
self._orig_color = fg
if self._forced_alpha:
if self._forced_alpha and isRGBA:
self._rgb = fg[:3] + (self._alpha,)
elif self._forced_alpha:
self._rgb = colors.colorConverter.to_rgba(fg, self._alpha)
elif isRGBA:
self._rgb = fg
Expand All @@ -1011,7 +1010,6 @@ def set_graylevel(self, frac):
"""
Set the foreground color to be a gray level with *frac*
"""
self._orig_color = frac
self._rgb = (frac, frac, frac, self._alpha)

def set_joinstyle(self, js):
Expand Down