diff options
author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
---|---|---|
committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/pptx/dml/effect.py | |
parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
download | gn-ai-master.tar.gz |
Diffstat (limited to '.venv/lib/python3.12/site-packages/pptx/dml/effect.py')
-rw-r--r-- | .venv/lib/python3.12/site-packages/pptx/dml/effect.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/pptx/dml/effect.py b/.venv/lib/python3.12/site-packages/pptx/dml/effect.py new file mode 100644 index 00000000..9df69ce4 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/pptx/dml/effect.py @@ -0,0 +1,41 @@ +"""Visual effects on a shape such as shadow, glow, and reflection.""" + +from __future__ import annotations + + +class ShadowFormat(object): + """Provides access to shadow effect on a shape.""" + + def __init__(self, spPr): + # ---spPr may also be a grpSpPr; both have a:effectLst child--- + self._element = spPr + + @property + def inherit(self): + """True if shape inherits shadow settings. + + Read/write. An explicitly-defined shadow setting on a shape causes + this property to return |False|. A shape with no explicitly-defined + shadow setting inherits its shadow settings from the style hierarchy + (and so returns |True|). + + Assigning |True| causes any explicitly-defined shadow setting to be + removed and inheritance is restored. Note this has the side-effect of + removing **all** explicitly-defined effects, such as glow and + reflection, and restoring inheritance for all effects on the shape. + Assigning |False| causes the inheritance link to be broken and **no** + effects to appear on the shape. + """ + if self._element.effectLst is None: + return True + return False + + @inherit.setter + def inherit(self, value): + inherit = bool(value) + if inherit: + # ---remove any explicitly-defined effects + self._element._remove_effectLst() + else: + # ---ensure at least the effectLst element is present + self._element.get_or_add_effectLst() |