From d483c41abdf41b4ed3e2f5cd71a8192c3a117862 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 10 Jul 2021 00:36:24 +1000 Subject: [PATCH] Updated documentation --- docs/reference/ImagePalette.rst | 4 ---- src/PIL/ImagePalette.py | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/reference/ImagePalette.rst b/docs/reference/ImagePalette.rst index f14c1c3a446..72ccfac7d83 100644 --- a/docs/reference/ImagePalette.rst +++ b/docs/reference/ImagePalette.rst @@ -9,10 +9,6 @@ represent the color palette of palette mapped images. .. note:: - This module was never well-documented. It hasn't changed since 2001, - though, so it's probably safe for you to read the source code and puzzle - out the internals if you need to. - The :py:class:`~PIL.ImagePalette.ImagePalette` class has several methods, but they are all marked as "experimental." Read that as you will. The ``[source]`` link is there for a reason. diff --git a/src/PIL/ImagePalette.py b/src/PIL/ImagePalette.py index 214059f5108..36fb7fd1385 100644 --- a/src/PIL/ImagePalette.py +++ b/src/PIL/ImagePalette.py @@ -25,12 +25,12 @@ class ImagePalette: """ Color palette for palette mapped images - :param mode: The mode to use for the Palette. See: + :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 be aligned - by channel (All R values must be contiguous in the list before G - and B values.) Defaults to 0 through 255 per channel. + 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. :param size: An optional palette size. If given, an error is raised if ``palette`` is not of equal length. """