| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/inkscape/extensions/__pycache__/ |
Upload File : |
o
0�a�
� @ sL d Z ddlZddlmZmZmZ G dd� dej�Zedkr$e� �� dS dS )z"
Export a gimp pallet file (.gpl)
� N)�ShapeElement�ColorIdError�
ColorErrorc @ s2 e Zd ZdZefZi Zdd� Zdd� Zdd� Z dS ) �ExportGimpPalettez0Export all colors in a document to a gimp palletc C s` | j j�dd�}|�d�|��d�� ttt| � � ���D ]\}}|�d�||��d�� qd S )Nz.svg� zGIMP Palette
Name: {}
#
zutf-8z{} {}
)
�svg�name�replace�write�format�encode�sorted�list�set�
get_colors)�self�streamr �key�value� r �5/usr/share/inkscape/extensions/export_gimp_palette.py�save! s
�zExportGimpPalette.savec c sd � | j j�t�D ]'}| �|�D ]}t|��� dkrqdj|�� � | j �
|�p+t|��� fV qqdS )z-Get all the colors from the selected elements�NONEz{:3d} {:3d} {:3d}N)r � selection�filterr �process_element�str�upperr �to_rgb�names�get)r �elem�colorr r r r ) s �*��zExportGimpPalette.get_colorsc c s� � |j dd�}tjjD ]L}zt�|�|��}|�� �d�dkr(|�� �� | j|<