HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/coloreffect.pyc
�
��Yc@s{dZddlZddlZddlZddlZddlZdZdZd
ZeeZ	d	ej
fd
��YZdS(s
Copyright (C) 2006 Jos Hirth, kaioa.com
Copyright (C) 2007 Aaron C. Spike
Copyright (C) 2009 Monash University

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
i����Ntfills
stop-colorsflood-colorslighting-colortstroketopacitytColorEffectcBskeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cCstjj|�g|_dS(N(tinkextEffectt__init__tvisited(tself((s-/usr/share/inkscape/extensions/coloreffect.pyRscCs_t|j�dkr.|j|jj��n-x*|jj�D]\}}|j|�q>WdS(Ni(tlentselectedt
getAttribstdocumenttgetroott	iteritems(Rtidtnode((s-/usr/share/inkscape/extensions/coloreffect.pyteffect#scCs/|j|�x|D]}|j|�qWdS(N(tchangeStyleR(RRtchild((s-/usr/share/inkscape/extensions/coloreffect.pyR*s

cCs�xTtD]L}|j|�}|r|j|�}||krS|j||�qSqqW|jjd�r�|jd�}|r�|jd�}t}x�t|�D]�\}}	|	jdd�}
t	|
�dkr�|
\}}|j
�j�}|tkr9|j
�}|j|�}||kr�|d|||<q�q�|tkr�t
}|j
�}|j|�}||kr�|d|||<q�q�q�q�W|s�|jd�}|jd|�n|jddj|��q�ndS(Ntstylet;t:it1Rsopacity:(tcolor_propstgettprocess_proptsettattribthas_keytsplittFalset	enumerateR	tstriptlowert
opacity_propstTruetappendtjoin(RRtattrtvaltnew_valRtdeclarationstopacity_in_styletitdecltpartstprop((s-/usr/share/inkscape/extensions/coloreffect.pyR/s>
cCs�tj|�rFtj|�}d|j|d|d|d�}n�|jd�r�|td�|jd�!}d|ttj�d�f}d	|}x3|j	j
|d
tj�D]}|j
||�q�Wd|}n|j|�}|S(Nt#iiisurl(#t)s%s-%di�s
//*[@id="%s"]t
namespacessurl(#%s)(tsimplestyletisColort
parseColortcolmodt
startswithR	tfindtinttrandomRtxpathRtNSStprocess_gradienttopacmod(RtcoltcRtnewidtpathR((s-/usr/share/inkscape/extensions/coloreffect.pyRas( 
"
c
Cs6tj|�}|jd|�|j�j|�|j|�x|D]}|j|�qFWtjdd�}|jj	|�r2|j
|�}|jd�r2|td�t|�!}d|t
tj�d�f}|j|d|�d|}	x6|jj|	d	tj�D]}|j||�qWq2ndS(
NRthreftxlinkR0s%s-%di�s#%ss
//*[@id="%s"]R2(tcopytdeepcopyRt	getparentR%RRtaddNSRRRR7R	R9R:RR;R<R=(
RRRAtnewnodeRRDRCRtnewhrefRB((s-/usr/share/inkscape/extensions/coloreffect.pyR=vs 	

 
"cCsdS(N((Rtrtgtb((s-/usr/share/inkscape/extensions/coloreffect.pyR6�scCs|S(N((RR((s-/usr/share/inkscape/extensions/coloreffect.pyR>�scCs�tt||�|�}tt||�|�}||}dddg}||d|d<|dkr~d|d<d|d<n|ddkr�||||d<n|d|||d<||kr�||||d<nJ||kr�d||||d<n%||kr$d||||d<n|dd|d<|ddkr[|dd|d<n|ddkr�|dd|d<n|S(	Ngg@iiig�?g@g@(tmaxtmin(RRKRLRMtrgb_maxtrgb_mintdeltathsl((s-/usr/share/inkscape/extensions/coloreffect.pyt
rgb_to_hsl�s.


cCs�|dkr|d7}n|dkr2|d8}n|dkrN||||S|dkr^|S|dkr~|||d|S|S(Nig@iiii((Rtv1tv2th((s-/usr/share/inkscape/extensions/coloreffect.pyt	hue_2_rgb�s

cCs�dddg}|dkr<||d<||d<||d<n�|dkrY|d|}n||||}d||}|j|||dd�|d<|j|||d�|d<|j|||dd�|d<|S(Niiig�?ig@(RX(RRWtstltrgbRVRU((s-/usr/share/inkscape/extensions/coloreffect.pyt
hsl_to_rgb�s


!!(
t__name__t
__module__RRRRRR=R6R>RTRXR\(((s-/usr/share/inkscape/extensions/coloreffect.pyRs				2						
(Rs
stop-colorsflood-colorslighting-color(R(sopacity(t__doc__tsysRER3RR:tcolor_props_filltcolor_props_strokeR#RRR(((s-/usr/share/inkscape/extensions/coloreffect.pyt<module>s0