Edit File: gradients.cpython-311.pyc
� ����m�d^����������������������������d�Z�ddlmZ�ddlmZmZ�ddlmZ��G�d��de������������Z�G�d��deee������������Z �G�d ��d e ������������Z �G�d��de ������������Zd S�)a �� 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. �����)�BaseElement)� Transform�XLink)� is_stringc��������������������$�������e�Zd�ZdZd��fd� Z��xZS�)� _GradientStop�stopNc������������������v�������t����������t����������|�������������j��������di�|���|�||�d<���|�||�d<���|�||�d<���d�S�d�S�)N�offsetz stop-colorzstop-opacity��)�superr����__init__)�selfr����color�opacity�extra� __class__s��� ��c/builddir/build/BUILD/cloudlinux-venv-1.0.2/venv/lib/python3.11/site-packages/svgwrite/gradients.pyr���z_GradientStop.__init__���sc�������+��m�T�"�"�+�4�4�e�4�4�4���#�D��N���!&�D�����#*�D�� � � ���������NNN)�__name__� __module__�__qualname__�elementnamer���� __classcell__�r���s���@r���r���r������sB����������������K�+��+��+��+��+��+��+��+��+��+r���r���c��������������������F�������e�Zd�ZdZd ��fd� Zdd�Zdd�Zd d�Z��fd �Z��xZ S�)�_AbstractGradient�gradientTransformNc��������������������������t����������t����������|�������������j��������di�|���|�Ot����������|������������r|����������������������|�������������d�S�|����������������������|������������������������������������������������d�S�d�S�)Nr���)r ���r���r���r����set_href�get_iri)r����inheritr���r���s��� �r���r���z_AbstractGradient.__init__%���s�������/����&�&�/�8�8�%�8�8�8�����!�!�� 1�� � �g�&�&�&�&�&�� � �g�o�o�/�/�0�0�0�0�0� ��r����nonec������������������4�����|��������������������������������������d|��S�)z( Returns the <FuncIRI> of the gradient. � )�get_funciri)r����defaults��� r����get_paint_serverz"_AbstractGradient.get_paint_server-���s!�������*�*�,�,�,�,�g�g�6�6r���c������������������R�����|�����������������������t����������||||���������������������������|�S�)a:�� 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 )�factory)�addr���)r���r���r���r���s��� r����add_stop_colorz _AbstractGradient.add_stop_color1���s,������� ����v�u�g�t�D�D�D�E�E�E��r����g��������g�������?c�����������������������|d���������|d���������z ��t����������|������������dz ��z��}|d���������}|D�],}|����������������������t����������|d������������||�������������||z ��}�-|�S�)z� 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 ����r�������)�lenr-����round)r����colors�sweepr����deltar���r���s��� r���� add_colorsz_AbstractGradient.add_colors?���so��������q��E�!�H�$��V���q��9���q����� �� �E�����f�a� 0� 0�%��A�A�A��e�O�F�F��r���c������������������������t����������|�d������������r|�������������������������������������t����������t����������|������������������������������������������������S�)N�href)�hasattr� update_idr ���r����get_xml)r���r���s��� �r���r<���z_AbstractGradient.get_xmlO���sB��������4�� � �� ��N�N�����&��-�-�5�5�7�7�7r���)N)r$���r���)r.���N) r���r���r���� transformnamer���r)���r-���r7���r<���r���r���s���@r���r���r���"���s����������������'�M�1��1��1��1��1��1�7��7��7��7��������������� 8��8��8��8��8��8��8��8��8r���r���c��������������������(�������e�Zd�ZdZdZd��fd� Z��xZS�)�LinearGradientzE Linear gradients are defined by a SVG <linearGradient> element. �linearGradientNc�������������������������t����������t����������|�������������j��������d d|i|���|�|d���������|�d<���|d���������|�d<���|�|d���������|�d<���|d���������|�d<���dS�dS�) z� :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** r#���Nr����x1r0����y1�x2�y2r���)r ���r?���r���)r����start�endr#���r���r���s��� �r���r���zLinearGradient.__init__Z���sw�������� -��n�d�#�#�,�F�F�W�F��F�F�F����q��D��J��q��D��J��?��Q��D��J��Q��D��J�J�J���?r���r����r���r���r����__doc__r���r���r���r���s���@r���r?���r?���U���sL������������������"�K� �� �� �� �� �� �� �� �� �� r���r?���c��������������������(�������e�Zd�ZdZdZd��fd� Z��xZS�)�RadialGradientzE Radial gradients are defined by a SVG <radialGradient> element. �radialGradientNc�������������������������t����������t����������|�������������j��������d d|i|���|�|d���������|�d<���|d���������|�d<���|�||�d<���|�|d���������|�d<���|d���������|�d <���dS�dS�)a-�� :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** r#���Nr����cxr0����cy�r�fx�fyr���)r ���rK���r���)r����centerrP����focalr#���r���r���s��� �r���r���zRadialGradient.__init__o���s��������� -��n�d�#�#�,�F�F�W�F��F�F�F������D��J����D��J��=��D��I����q��D��J��q��D��J�J�J���r���)NNNNrH���r���s���@r���rK���rK���j���sL������������������"�K�"��"��"��"��"��"��"��"��"��"r���rK���N)rI���� svgwrite.baser����svgwrite.mixinsr���r����svgwrite.utilsr���r���r���r?���rK���r���r���r����<module>rX������s��������&��%��%��%��%��%��,��,��,��,��,��,��,��,��$��$��$��$��$��$�+��+��+��+��+�K��+��+��+�08��08��08��08��08��Y���08��08��08�f �� �� �� �� �&�� �� �� �*"��"��"��"��"�&��"��"��"��"��"r���