MCPcopy Create free account
hub / github.com/PageBot/PageBot / _getAlpha

Method _getAlpha

Lib/pagebot/elements/image.py:299–306  ·  view source on GitHub ↗

Use alpha channel of the fill color as opacity of the image.

(self)

Source from the content-addressed store, hash-verified

297 return self.doc.context.imagePixelColor(self.path, p)
298
299 def _getAlpha(self):
300 """Use alpha channel of the fill color as opacity of the image."""
301 sFill = self.css('fill', noColor)
302 if isinstance(sFill, (tuple, list)) and len(sFill) == 4:
303 _, _, _, alpha = sFill
304 else:
305 alpha = 1
306 return alpha
307
308 def _scaleImage(self, view):
309 """If the self.saveScaled is True and the reduction scale is inside the

Callers 2

build_indsMethod · 0.95
buildMethod · 0.95

Calls 1

cssMethod · 0.45

Tested by

no test coverage detected