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

Class _GradientStop

src/pptx/dml/fill.py:370–398  ·  view source on GitHub ↗

A single gradient stop. A gradient stop defines a color and a position.

Source from the content-addressed store, hash-verified

368
369
370class _GradientStop(ElementProxy):
371 """A single gradient stop.
372
373 A gradient stop defines a color and a position.
374 """
375
376 def __init__(self, gs):
377 super(_GradientStop, self).__init__(gs)
378 self._gs = gs
379
380 @lazyproperty
381 def color(self):
382 """Return |ColorFormat| object controlling stop color."""
383 return ColorFormat.from_colorchoice_parent(self._gs)
384
385 @property
386 def position(self):
387 """Location of stop in gradient path as float between 0.0 and 1.0.
388
389 The value represents a percentage, where 0.0 (0%) represents the
390 start of the path and 1.0 (100%) represents the end of the path. For
391 a linear gradient, these would represent opposing extents of the
392 filled area.
393 """
394 return self._gs.pos
395
396 @position.setter
397 def position(self, value):
398 self._gs.pos = float(value)

Callers 5

pos_get_fixtureMethod · 0.90
pos_set_fixtureMethod · 0.90
raises_fixtureMethod · 0.90
__getitem__Method · 0.85

Calls

no outgoing calls

Tested by 4

pos_get_fixtureMethod · 0.72
pos_set_fixtureMethod · 0.72
raises_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…