@@ -783,7 +783,6 @@ def __init__(self):
783
783
self ._linestyle = 'solid'
784
784
self ._linewidth = 1
785
785
self ._rgb = (0.0 , 0.0 , 0.0 , 1.0 )
786
- self ._orig_color = (0.0 , 0.0 , 0.0 , 1.0 )
787
786
self ._hatch = None
788
787
self ._url = None
789
788
self ._gid = None
@@ -803,7 +802,6 @@ def copy_properties(self, gc):
803
802
self ._linestyle = gc ._linestyle
804
803
self ._linewidth = gc ._linewidth
805
804
self ._rgb = gc ._rgb
806
- self ._orig_color = gc ._orig_color
807
805
self ._hatch = gc ._hatch
808
806
self ._url = gc ._url
809
807
self ._gid = gc ._gid
@@ -937,7 +935,7 @@ def set_alpha(self, alpha):
937
935
else :
938
936
self ._alpha = 1.0
939
937
self ._forced_alpha = False
940
- self .set_foreground (self ._orig_color )
938
+ self .set_foreground (self ._rgb , isRGBA = True )
941
939
942
940
def set_antialiased (self , b ):
943
941
"""
@@ -999,8 +997,9 @@ def set_foreground(self, fg, isRGBA=False):
999
997
1000
998
If you know fg is rgba, set ``isRGBA=True`` for efficiency.
1001
999
"""
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 :
1004
1003
self ._rgb = colors .colorConverter .to_rgba (fg , self ._alpha )
1005
1004
elif isRGBA :
1006
1005
self ._rgb = fg
@@ -1011,7 +1010,6 @@ def set_graylevel(self, frac):
1011
1010
"""
1012
1011
Set the foreground color to be a gray level with *frac*
1013
1012
"""
1014
- self ._orig_color = frac
1015
1013
self ._rgb = (frac , frac , frac , self ._alpha )
1016
1014
1017
1015
def set_joinstyle (self , js ):
0 commit comments