%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/svgwrite/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyo

�
oQ+Pc@s�dZddlmZddlmZmZddlmZdefd��YZdeeefd��YZ	d	e	fd
��YZ
de	fd��YZd
S(s	
Gradients consist of continuously smooth color transitions along a vector
from one color to another, possibly followed by additional transitions along
the same vector to other colors. SVG provides for two types of gradients:
linear gradients and radial gradients.
i����(tBaseElement(t	TransformtXLink(t	is_stringt
_GradientStopcBs eZdZdddd�ZRS(tstopcKsett|�j|�|dk	r/||d<n|dk	rH||d<n|dk	ra||d<ndS(Ntoffsets
stop-colorsstop-opacity(tsuperRt__init__tNone(tselfRtcolortopacitytextra((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyRs

N(t__name__t
__module__telementnameR	R(((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyRst_AbstractGradientcBsPeZdZd	d�Zdd�Zd	d	d	d�Zd
d	d�Zd�ZRS(tgradientTransformcKsXtt|�j|�|dk	rTt|�r>|j|�qT|j|j��ndS(N(RRRR	Rtset_hreftget_iri(R
tinheritR
((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyR s
tnonecCsd|j�|fS(s( Returns the <FuncIRI> of the gradient. s%s %s(tget_funciri(R
tdefault((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pytget_paint_server(scCs#|jt|||d|��|S(s: Adds a stop-color to the gradient.

        :param offset: is either a <number> (usually ranging from 0 to 1) or
          a `<percentage>` (usually ranging from 0% to 100%) which indicates where
          the gradient stop is placed. Represents a location along the gradient
          vector. For radial gradients, it represents a percentage distance from
          (fx,fy) to the edge of the outermost/largest circle.
        :param color: indicates what color to use at that gradient stop
        :param opacity: defines the opacity of a given gradient stop
        tfactory(taddR(R
RRR((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pytadd_stop_color,sgg�?c	Cst|d�}t|d�}||tt|�d�}|}x4|D],}|jt|d�||�||7}qKW|S(s� Add stop-colors from colors with linear offset distributuion
        from sweep[0] to sweep[1].

        i.e. colors=['white', 'red', 'blue']
          'white': offset = 0.0
          'red': offset = 0.5
          'blue': offset = 1.0
        iii(tfloattlenRtround(	R
tcolorstsweepRtstarttendtdeltaRR((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyt
add_colors:s	
cCs/t|d�r|j�ntt|�j�S(Nthref(thasattrt	update_idRRtget_xml(R
((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyR)Ls
N(gg�?(	RRt
transformnameR	RRRR%R)(((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyRstLinearGradientcBs&eZdZdZdddd�ZRS(sE Linear gradients are defined by a SVG <linearGradient> element.
    tlinearGradientcKsvtt|�jd||�|dk	rG|d|d<|d|d<n|dk	rr|d|d<|d|d<ndS(	s�
        :param 2-tuple start: start point of the gradient (**x1**, **y1**)
        :param 2-tuple end: end point of the gradient (**x2**, **y2**)
        :param inherit: gradient inherits properties from `inherit` see: **xlink:href**

        Ritx1ity1tx2ty2N(RR+RR	(R
R"R#RR
((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyRUsN(RRt__doc__RR	R(((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyR+QstRadialGradientcBs)eZdZdZddddd�ZRS(sE Radial gradients are defined by a SVG <radialGradient> element.
    tradialGradientcKs�tt|�jd||�|d	k	rG|d|d<|d|d<n|d	k	r`||d<n|d	k	r�|d|d<|d|d<nd	S(
s-
        :param 2-tuple center: center point for the gradient (**cx**, **cy**)
        :param r: radius for the gradient
        :param 2-tuple focal: focal point for the radial gradient (**fx**, **fy**)
        :param inherit: gradient inherits properties from `inherit` see: **xlink:href**

        RitcxitcytrtfxtfyN(RR2RR	(R
tcenterR6tfocalRR
((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyRhs	
N(RRR1RR	R(((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyR2dsN(R1t
svgwrite.baseRtsvgwrite.mixinsRRtsvgwrite.utilsRRRR+R2(((sC/opt/alt/python27/lib/python2.7/site-packages/svgwrite/gradients.pyt<module>s3

Zerion Mini Shell 1.0