Use alpha channel of the fill color as opacity of the image.
(self)
| 109 | return self.doc.context.imagePixelColor(self.path, p) |
| 110 | |
| 111 | def _getAlpha(self): |
| 112 | """Use alpha channel of the fill color as opacity of the image.""" |
| 113 | sFill = self.css('fill', noColor) |
| 114 | if isinstance(sFill, (tuple, list)) and len(sFill) == 4: |
| 115 | _, _, _, alpha = sFill |
| 116 | else: |
| 117 | alpha = 1 |
| 118 | return alpha |
| 119 | |
| 120 | def build(self, view, origin=ORIGIN, **kwargs): |
| 121 | """Draw the image in the calculated scale. Since we need to use the |