
    Rf                    8    d dl mZ ddlmZ  G d d          ZdS )    )annotations   )o8c                  "    e Zd ZdZdZd Zd ZdS )PaletteFilez-File handler for Teragon-style palette files.RGBc                &   d t          d          D             | _        	 |                                }|sn|d d         dk    r't          |          dk    rd}t	          |          d |                                D             }	 |\  }}}}n# t          $ r |\  }}|x}}Y nw xY wd	|cxk    rd
k    r:n n7t          |          t          |          z   t          |          z   | j        |<   d                    | j                  | _        d S )Nc                    g | ]}|||fS  r   ).0is     A/var/www/html/env/lib/python3.11/site-packages/PIL/PaletteFile.py
<listcomp>z(PaletteFile.__init__.<locals>.<listcomp>   s    666aAq	666       Tr      #d   zbad palette filec                ,    g | ]}t          |          S r   )int)r   xs     r   r   z(PaletteFile.__init__.<locals>.<listcomp>'   s    +++AQ+++r   r      r   )	rangepalettereadlinelenSyntaxErrorsplit
ValueErrorr   join)	selffpsmsgvr   rgbs	            r   __init__zPaletteFile.__init__   s1   665::666	8A !u}}1vv||(!#&&&+++++A Aq!!   A	AAA A}}}}}}}}}"$Q%%"Q%%-"Q%%"7Q'	8* xx--s   	B B'&B'c                    | j         | j        fS )N)r   rawmode)r    s    r   
getpalettezPaletteFile.getpalette3   s    |T\))r   N)__name__
__module____qualname____doc__r*   r(   r+   r   r   r   r   r      s=        77G. . .4* * * * *r   r   N)
__future__r   _binaryr   r   r   r   r   <module>r2      s]    # " " " " "       *  *  *  *  *  *  *  *  *  *r   