MCPcopy Create free account
hub / github.com/scanny/python-pptx / _Background

Class _Background

src/pptx/slide.py:459–498  ·  view source on GitHub ↗

Provides access to slide background properties. Note that the presence of this object does not by itself imply an explicitly-defined background; a slide with an inherited background still has a |_Background| object.

Source from the content-addressed store, hash-verified

457
458
459class _Background(ElementProxy):
460 """Provides access to slide background properties.
461
462 Note that the presence of this object does not by itself imply an
463 explicitly-defined background; a slide with an inherited background still
464 has a |_Background| object.
465 """
466
467 def __init__(self, cSld: CT_CommonSlideData):
468 super(_Background, self).__init__(cSld)
469 self._cSld = cSld
470
471 @lazyproperty
472 def fill(self):
473 """|FillFormat| instance for this background.
474
475 This |FillFormat| object is used to interrogate or specify the fill
476 of the slide background.
477
478 Note that accessing this property is potentially destructive. A slide
479 background can also be specified by a background style reference and
480 accessing this property will remove that reference, if present, and
481 replace it with NoFill. This is frequently the case for a slide
482 master background.
483
484 This is also the case when there is no explicitly defined background
485 (background is inherited); merely accessing this property will cause
486 the background to be set to NoFill and the inheritance link will be
487 interrupted. This is frequently the case for a slide background.
488
489 Of course, if you are accessing this property in order to set the
490 fill, then these changes are of no consequence, but the existing
491 background cannot be reliably interrogated using this property unless
492 you have already established it is an explicit fill.
493
494 If the background is already a fill, then accessing this property
495 makes no changes to the current background.
496 """
497 bgPr = self._cSld.get_or_add_bgPr()
498 return FillFormat.from_fill_parent(bgPr)

Callers 2

backgroundMethod · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…