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

Skip to content

Commit bf8d9d6

Browse files
committed
Fix unpacking of rgb values to explicitly extract the first 3 values (alpha channel was getting included).
1 parent 04b4e50 commit bf8d9d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_emf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self,emf,gc):
6666
self.emf=emf
6767
self.gc=gc
6868

69-
r,g,b=gc.get_rgb()
69+
r,g,b=gc.get_rgb()[:3]
7070
self.r=int(r*255)
7171
self.g=int(g*255)
7272
self.b=int(b*255)
@@ -102,7 +102,7 @@ def get_handle(self):
102102
class EMFBrush:
103103
def __init__(self,emf,rgb):
104104
self.emf=emf
105-
r,g,b=rgb
105+
r,g,b=rgb[:3]
106106
self.r=int(r*255)
107107
self.g=int(g*255)
108108
self.b=int(b*255)

0 commit comments

Comments
 (0)