
     f                    L    d dl mZ d dlZd dlmZ ddlmZ  G d d          ZdS )    )annotationsN)IO   o8c                  &    e Zd ZdZdZddZdd	Zd
S )GimpPaletteFilez'File handler for GIMP's palette format.RGBfp	IO[bytes]returnNonec           	        d t          d          D             }|                                d d         dk    rd}t          |          t          d          D ]}|                                }|s nt          j        d|          r0t          |          dk    rd}t          |          t          t          t          |	                                d d	                             }t          |          d	k    rd
}t          |          t          |d                   t          |d                   z   t          |d                   z   ||<   d                    |          | _        d S )Nc                2    g | ]}t          |          d z  S )   r   ).0is     V/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/PIL/GimpPaletteFile.py
<listcomp>z,GimpPaletteFile.__init__.<locals>.<listcomp>   s"    1112a5519111          s   GIMP Paletteznot a GIMP palette files   \w+:|#d   zbad palette filer   zbad palette entryr   r      r   )rangereadlineSyntaxErrorrematchlentuplemapintsplit
ValueErrorr   joinpalette)selfr   r'   msgr   svs          r   __init__zGimpPaletteFile.__init__   sE   11eCjj111;;=="00+Cc"""s 	8 	8AA  x
A&& 1vv||(!#&&&c#qwwyy!}--..A1vv{{) oo%AaDBqtHH,r!A$xx7GAJJxx((r   tuple[bytes, str]c                    | j         | j        fS )N)r'   rawmode)r(   s    r   
getpalettezGimpPaletteFile.getpalette9   s    |T\))r   N)r   r   r   r   )r   r-   )__name__
__module____qualname____doc__r/   r,   r0    r   r   r	   r	      sG        11G) ) ) )8* * * * * *r   r	   )
__future__r   r   typingr   _binaryr   r	   r5   r   r   <module>r9      sx     # " " " " " 				            "* "* "* "* "* "* "* "* "* "*r   