
    Mi4                       S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJrJrJrJrJrJr  SSKJr  SS	KJr  SS
KJr  \(       a  SSK	Jr  SSKJr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r" " S S\5      r# " S  S!\5      r$g")#z"DrawingML objects related to fill.    )annotations)Sequence)TYPE_CHECKING)ColorFormat)MSO_FILL)CT_BlipFillPropertiesCT_GradientFillPropertiesCT_GroupFillPropertiesCT_NoFillPropertiesCT_PatternFillPropertiesCT_SolidColorFillProperties)BaseOxmlElement)ElementProxy)lazyproperty)MSO_FILL_TYPEc                    ^  \ rS rSrSrSU 4S jjr\SS j5       r\S 5       r	S r
\S 5       rS r\S	 5       r\R                  S
 5       r\S 5       r\S 5       r\R                  S 5       rS rS r\SS j5       rSrU =r$ )
FillFormat   z`Provides access to the current fill properties.

Also provides methods to change the fill type.
c                B   > [         [        U ]  5         Xl        X l        g N)superr   __init___xPr_fill)selfeg_fill_properties_parentfill_obj	__class__s      g/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/pptx/dml/fill.pyr   FillFormat.__init__!   s    j$(*-	
    c                D    UR                   n[        U5      nU " X5      nU$ )z
Return a |FillFormat| instance initialized to the settings contained
in *eg_fillProperties_parent*, which must be an element having
EG_FillProperties in its child element sequence in the XML schema.
)eg_fillProperties_Fill)clseg_fillProperties_parentfill_elmfillfill_formats        r   from_fill_parentFillFormat.from_fill_parent&   s)     ,==X29r!   c                .    U R                   R                  $ )z{Return a |ColorFormat| object representing background color.

This property is only applicable to pattern fills and lines.
)r   
back_colorr   s    r   r-   FillFormat.back_color2        zz$$$r!   c                X    U R                   R                  5       n[        U5      U l        g)z1
Sets the fill type to noFill, i.e. transparent.
N)r   get_or_change_to_noFill_NoFillr   )r   noFills     r   
backgroundFillFormat.background:   s!     224V_
r!   c                .    U R                   R                  $ )zQ
Return a |ColorFormat| instance representing the foreground color of
this fill.
)r   
fore_colorr.   s    r   r8   FillFormat.fore_colorA   r0   r!   c                X    U R                   R                  5       n[        U5      U l        g)a  Sets the fill type to gradient.

If the fill is not already a gradient, a default gradient is added.
The default gradient corresponds to the default in the built-in
PowerPoint "White" template. This gradient is linear at angle
90-degrees (upward), with two stops. The first stop is Accent-1 with
tint 100%, shade 100%, and satMod 130%. The second stop is Accent-1
with tint 50%, shade 100%, and satMod 350%.
N)r   get_or_change_to_gradFill	_GradFillr   r   gradFills     r   gradientFillFormat.gradientI   s"     99668x(
r!   c                    U R                   [        R                  :w  a  [        S5      eU R                  R
                  $ )a  Angle in float degrees of line of a linear gradient.

Read/Write. May be |None|, indicating the angle should be inherited
from the style hierarchy. An angle of 0.0 corresponds to
a left-to-right gradient. Increasing angles represent
counter-clockwise rotation of the line, for example 90.0 represents
a bottom-to-top gradient. Raises |TypeError| when the fill type is
not MSO_FILL_TYPE.GRADIENT. Raises |ValueError| for a non-linear
gradient (e.g. a radial gradient).
*Fill is not of type MSO_FILL_TYPE.GRADIENTtyper   GRADIENT	TypeErrorr   gradient_angler.   s    r   rG   FillFormat.gradient_angleV   s2     99)))HIIzz(((r!   c                v    U R                   [        R                  :w  a  [        S5      eXR                  l        g )NrB   rC   r   values     r   rG   rH   f   s*    99)))HII$)

!r!   c                    U R                   [        R                  :w  a  [        S5      eU R                  R
                  $ )z|GradientStops| object providing access to stops of this gradient.

Raises |TypeError| when fill is not gradient (call `fill.gradient()`
first). Each stop represents a color between which the gradient
smoothly transitions.
rB   )rD   r   rE   rF   r   gradient_stopsr.   s    r   rM   FillFormat.gradient_stopsl   s2     99)))HIIzz(((r!   c                .    U R                   R                  $ )a  Return member of :ref:`MsoPatternType` indicating fill pattern.

Raises |TypeError| when fill is not patterned (call
`fill.patterned()` first). Returns |None| if no pattern has been set;
PowerPoint may display the default `PERCENT_5` pattern in this case.
Assigning |None| will remove any explicit pattern setting, although
relying on the default behavior is discouraged and may produce
rendering differences across client applications.
r   patternr.   s    r   rQ   FillFormat.patternx   s     zz!!!r!   c                $    XR                   l        g r   rP   r   pattern_types     r   rQ   rR      s    )

r!   c                X    U R                   R                  5       n[        U5      U l        g)zSelects the pattern fill type.

Note that calling this method does not by itself set a foreground or
background color of the pattern. Rather it enables subsequent
assignments to properties like fore_color to set the pattern and
colors.
N)r   get_or_change_to_pattFill	_PattFillr   )r   pattFills     r   	patternedFillFormat.patterned   s"     99668x(
r!   c                X    U R                   R                  5       n[        U5      U l        g)z
Sets the fill type to solid, i.e. a solid color. Note that calling
this method does not set a color or by itself cause the shape to
appear with a solid color fill; rather it enables subsequent
assignments to properties like fore_color to set the color.
N)r   get_or_change_to_solidFill
_SolidFillr   )r   	solidFills     r   solidFillFormat.solid   s"     II88:		*
r!   c                .    U R                   R                  $ )z2The type of this fill, e.g. `MSO_FILL_TYPE.SOLID`.)r   rD   r.   s    r   rD   FillFormat.type   s     zzr!   )r   r   )r   r   r   r$   )r&   r   returnr   rd   r   )__name__
__module____qualname____firstlineno____doc__r   classmethodr*   propertyr-   r5   r8   r?   rG   setterrM   rQ   rZ   r`   rD   __static_attributes____classcell__r   s   @r   r   r      s    

 	 	 % %% % %) ) ) * *
 	) 	) 
" 
" ^^* *	)+  r!   r   c                  p   ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r\S 5       r	\S	S j5       r
SrU =r$ )
r$      z
Object factory for fill object of class matching fill element, such as
_SolidFill for ``<a:solidFill>``; also serves as the base class for all
fill classes
c                  > Uc  [         nO[        U[        5      (       a  [        nO[        U[        5      (       a  [
        nOv[        U[        5      (       a  [        nOZ[        U[        5      (       a  [        nO>[        U[        5      (       a  [        nO"[        U[        5      (       a  [        nO[        n[        [        U ]C  U5      $ r   )	_NoneFill
isinstancer   	_BlipFillr	   r<   r
   _GrpFillr   r3   r   rX   r   r^   r$   r   __new__)r%   xFillfill_clsr   s      r   rx   _Fill.__new__   s    = H455 H899 H566H233H788 H:;;!HHUC(22r!   c                H    Sn[        XR                  R                  -  5      e)=Raise TypeError for types that do not override this property.z=fill type %s has no background color, call .patterned() firstrF   r   rf   r   tmpls     r   r-   _Fill.back_color   s"     O~~66677r!   c                H    Sn[        XR                  R                  -  5      e)r}   zIfill type %s has no foreground color, call .solid() or .patterned() firstr~   r   s     r   r8   _Fill.fore_color   s"     ^~~66677r!   c                H    Sn[        XR                  R                  -  5      e)z=Raise TypeError for fills that do not override this property.z4fill type %s has no pattern, call .patterned() firstr~   r   s     r   rQ   _Fill.pattern   s"     F~~66677r!   c                F    [        SU R                  R                   35      e)Nz&.type property must be implemented on )NotImplementedErrorr   rf   r.   s    r   rD   
_Fill.type   s$    !4T^^5L5L4MN
 	
r!    re   )rf   rg   rh   ri   rj   rx   rl   r-   r8   rQ   rD   rn   ro   rp   s   @r   r$   r$      s]    3& 8 8
 8 8
 8 8
 
 
r!   r$   c                  $    \ rS rSr\S 5       rSrg)rv      c                "    [         R                  $ r   )r   PICTUREr.   s    r   rD   _BlipFill.type   s    r!   r   Nrf   rg   rh   ri   rl   rD   rn   r   r!   r   rv   rv      s       r!   rv   c                  r    \ rS rSrSrS r\S 5       r\R                  S 5       r\	S 5       r
\S 5       rSrg	)
r<      z Proxies an `a:gradFill` element.c                     U=U l         U l        g r   _element	_gradFillr=   s     r   r   _GradFill.__init__   s    )11r!   c                    U R                   R                  nUb  [        S5      eU R                   R                  nUc  gUR                  nUS:X  a  SnU$ SU-
  nU$ )a  Angle in float degrees of line of a linear gradient.

Read/Write. May be |None|, indicating the angle is inherited from the
style hierarchy. An angle of 0.0 corresponds to a left-to-right
gradient. Increasing angles represent clockwise rotation of the line,
for example 90.0 represents a top-to-bottom gradient. Raises
|TypeError| when the fill type is not MSO_FILL_TYPE.GRADIENT. Raises
|ValueError| for a non-linear gradient (e.g. a radial gradient).
Nnot a linear gradientg             v@)r   path
ValueErrorlinang)r   r   r   clockwise_anglecounter_clockwise_angles        r   rG   _GradFill.gradient_angle   sq     ~~""455 nn  ; '')8C)?#&& GLoF]&&r!   c                `    U R                   R                  nUc  [        S5      eSU-
  Ul        g )Nr   r   )r   r   r   r   )r   rK   r   s      r   rG   r     s-    nn  ;455%-r!   c                H    [        U R                  R                  5       5      $ )z|_GradientStops| object providing access to gradient colors.

Each stop represents a color between which the gradient smoothly
transitions.
)_GradientStopsr   get_or_add_gsLstr.   s    r   rM   _GradFill.gradient_stops  s     dnn==?@@r!   c                "    [         R                  $ r   )r   rE   r.   s    r   rD   _GradFill.type  s       r!   r   N)rf   rg   rh   ri   rj   r   rl   rG   rm   r   rM   rD   rn   r   r!   r   r<   r<      sb    *2 ' ':     A A ! !r!   r<   c                  $    \ rS rSr\S 5       rSrg)rw   i  c                "    [         R                  $ r   )r   GROUPr.   s    r   rD   _GrpFill.type      ~~r!   r   Nr   r   r!   r   rw   rw     s     r!   rw   c                  $    \ rS rSr\S 5       rSrg)r3   i  c                "    [         R                  $ r   )r   
BACKGROUNDr.   s    r   rD   _NoFill.type  s    """r!   r   Nr   r   r!   r   r3   r3     s    # #r!   r3   c                  $    \ rS rSr\S 5       rSrg)rt   i"  c                    g r   r   r.   s    r   rD   _NoneFill.type#  s    r!   r   Nr   r   r!   r   rt   rt   "  s     r!   rt   c                     ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r\	S 5       r
\
R                  S 5       r
\	S 5       rS	rU =r$ )
rX   i(  z-Provides access to patterned fill properties.c                F   > [         [        U ]  5         U=U l        U l        g r   )r   rX   r   r   	_pattFill)r   rY   r   s     r   r   _PattFill.__init__+  s    i'))11r!   c                b    U R                   R                  5       n[        R                  " U5      $ )z;Return |ColorFormat| object that controls background color.)r   get_or_add_bgClrr   from_colorchoice_parent)r   bgClrs     r   r-   _PattFill.back_color/  '     //122599r!   c                b    U R                   R                  5       n[        R                  " U5      $ )z;Return |ColorFormat| object that controls foreground color.)r   get_or_add_fgClrr   r   )r   fgClrs     r   r8   _PattFill.fore_color5  r   r!   c                .    U R                   R                  $ )zReturn member of :ref:`MsoPatternType` indicating fill pattern.

Returns |None| if no pattern has been set; PowerPoint may display the
default `PERCENT_5` pattern in this case. Assigning |None| will
remove any explicit pattern setting.
r   prstr.   s    r   rQ   _PattFill.pattern;  s     ~~"""r!   c                $    XR                   l        g r   r   rT   s     r   rQ   r   E  s    *r!   c                "    [         R                  $ r   )r   	PATTERNEDr.   s    r   rD   _PattFill.typeI  s    !!!r!   )r   r   )rf   rg   rh   ri   rj   r   r   r-   r8   rl   rQ   rm   rD   rn   ro   rp   s   @r   rX   rX   (  ss    72 : :
 : :
 # # ^^+ + " "r!   rX   c                  L   ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r	Sr
U =r$ )r^   iN  zAProvides access to fill properties such as color for solid fills.c                6   > [         [        U ]  5         Xl        g r   )r   r^   r   
_solidFill)r   r_   r   s     r   r   _SolidFill.__init__Q  s    j$(*#r!   c                B    [         R                  " U R                  5      $ )z3Return |ColorFormat| object controlling fill color.)r   r   r   r.   s    r   r8   _SolidFill.fore_colorU  s     224??CCr!   c                "    [         R                  $ r   )r   SOLIDr.   s    r   rD   _SolidFill.typeZ  r   r!   )r   )rf   rg   rh   ri   rj   r   r   r8   rl   rD   rn   ro   rp   s   @r   r^   r^   N  s5    K$ D D  r!   r^   c                  *    \ rS rSrSrS rS rS rSrg)r   i_  a  Collection of |GradientStop| objects defining gradient colors.

A gradient must have a minimum of two stops, but can have as many more
than that as required to achieve the desired effect (three is perhaps
most common). Stops are sequenced in the order they are transitioned
through.
c                    Xl         g r   _gsLst)r   gsLsts     r   r   _GradientStops.__init__h  s    r!   c                2    [        U R                  U   5      $ r   )_GradientStopr   )r   idxs     r   __getitem___GradientStops.__getitem__k  s    T[[-..r!   c                ,    [        U R                  5      $ r   )lenr   r.   s    r   __len___GradientStops.__len__n  s    4;;r!   r   N)	rf   rg   rh   ri   rj   r   r   r   rn   r   r!   r   r   r   _  s    / r!   r   c                  p   ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r	\	R                  S 5       r	SrU =r$ )r   ir  zIA single gradient stop.

A gradient stop defines a color and a position.
c                8   > [         [        U ]  U5        Xl        g r   )r   r   r   _gs)r   gsr   s     r   r   _GradientStop.__init__x  s    mT+B/r!   c                B    [         R                  " U R                  5      $ )z3Return |ColorFormat| object controlling stop color.)r   r   r   r.   s    r   color_GradientStop.color|  s     22488<<r!   c                .    U R                   R                  $ )a  Location of stop in gradient path as float between 0.0 and 1.0.

The value represents a percentage, where 0.0 (0%) represents the
start of the path and 1.0 (100%) represents the end of the path. For
a linear gradient, these would represent opposing extents of the
filled area.
)r   posr.   s    r   position_GradientStop.position  s     xx||r!   c                8    [        U5      U R                  l        g r   )floatr   r   rJ   s     r   r   r     s    U|r!   )r   )rf   rg   rh   ri   rj   r   r   r   rl   r   rm   rn   ro   rp   s   @r   r   r   r  sM    
 = =   __$ $r!   r   N)%rj   
__future__r   collections.abcr   typingr   pptx.dml.colorr   pptx.enum.dmlr   pptx.oxml.dml.fillr   r	   r
   r   r   r   pptx.oxml.xmlchemyr   pptx.sharedr   	pptx.utilr   r   objectr   r$   rv   r<   rw   r3   rt   rX   r^   r   r   r   r!   r   <module>r      s    ( " $   & "  / $ "+2F FR0
F 0
f   6! 6!ru #e # #" #"L " X  &$L $r!   