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

Class _PattFill

src/pptx/dml/fill.py:296–331  ·  view source on GitHub ↗

Provides access to patterned fill properties.

Source from the content-addressed store, hash-verified

294
295
296class _PattFill(_Fill):
297 """Provides access to patterned fill properties."""
298
299 def __init__(self, pattFill):
300 super(_PattFill, self).__init__()
301 self._element = self._pattFill = pattFill
302
303 @lazyproperty
304 def back_color(self):
305 """Return |ColorFormat| object that controls background color."""
306 bgClr = self._pattFill.get_or_add_bgClr()
307 return ColorFormat.from_colorchoice_parent(bgClr)
308
309 @lazyproperty
310 def fore_color(self):
311 """Return |ColorFormat| object that controls foreground color."""
312 fgClr = self._pattFill.get_or_add_fgClr()
313 return ColorFormat.from_colorchoice_parent(fgClr)
314
315 @property
316 def pattern(self):
317 """Return member of :ref:`MsoPatternType` indicating fill pattern.
318
319 Returns |None| if no pattern has been set; PowerPoint may display the
320 default `PERCENT_5` pattern in this case. Assigning |None| will
321 remove any explicit pattern setting.
322 """
323 return self._pattFill.prst
324
325 @pattern.setter
326 def pattern(self, pattern_type):
327 self._pattFill.prst = pattern_type
328
329 @property
330 def type(self):
331 return MSO_FILL.PATTERNED
332
333
334class _SolidFill(_Fill):

Callers 6

back_color_fixtureMethod · 0.90
fore_color_fixtureMethod · 0.90
fill_type_fixtureMethod · 0.90
pattern_get_fixtureMethod · 0.90
pattern_set_fixtureMethod · 0.90
patternedMethod · 0.85

Calls

no outgoing calls

Tested by 5

back_color_fixtureMethod · 0.72
fore_color_fixtureMethod · 0.72
fill_type_fixtureMethod · 0.72
pattern_get_fixtureMethod · 0.72
pattern_set_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…