Skip to content

Commit 8c5a6e0

Browse files
committed
FIX: implement get_rgb for GraphicsContextCairo
Was falling back to the base implementation of get_rgb which looks at a local variable which was getting out of sync with the stack. Now consults the underlying cairo context. Closes #4024 for cairo based backends
1 parent 32a3292 commit 8c5a6e0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/backends/backend_cairo.py

+2
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ def set_graylevel(self, frac):
397397
else:
398398
self.ctx.set_source_rgba(*self._rgb)
399399

400+
def get_rgb(self):
401+
return self.ctx.get_source().get_rgba()[:3]
400402

401403
def set_joinstyle(self, js):
402404
if js in ('miter', 'round', 'bevel'):

0 commit comments

Comments
 (0)