文件操作 - ImagePalette.cpython-311.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/PIL/__pycache__/ImagePalette.cpython-311.pyc
编辑文件内容
� �"�c� � � � d dl Z ddlmZmZmZmZ ddlmZ G d� d� � Zd� Z d� Z d � Zdd�Zdd�Z dd�Zdd�Zd� ZdS )� N� )�GimpGradientFile�GimpPaletteFile� ImageColor�PaletteFile)� deprecatec � � e Zd ZdZdd�Zed� � � Zej d� � � Zed� � � Zej d � � � Zd � Z d� Z d� ZeZdd �Z d� ZdS )�ImagePalettea� Color palette for palette mapped images :param mode: The mode to use for the palette. See: :ref:`concept-modes`. Defaults to "RGB" :param palette: An optional palette. If given, it must be a bytearray, an array or a list of ints between 0-255. The list must consist of all channels for one color followed by the next color (e.g. RGBRGBRGB). Defaults to an empty palette. �RGBNr c �� � || _ d | _ |p t � � | _ d | _ |dk r:t ddd � � |t | j � � k rd}t |� � �d S d S )Nr zThe size parameter� zwrong palette size)�mode�rawmode� bytearray�palette�dirtyr �len� ValueError)�selfr r �size�msgs �2/usr/lib/python3/dist-packages/PIL/ImagePalette.py�__init__zImagePalette.__init__% sv � ��� �����-�)�+�+����� ��1�9�9��*�B��5�5�5��s�4�<�(�(�(�(�*�� ��o�o�%� �9�(�(� c � � | j S �N)�_palette�r s r r zImagePalette.palette0 s � ��}�r c �"