public void setPalette(int[] rgb) {
            if (rgb.length < 1*3 || rgb.length > 256*3) {
                throw new
                  IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam0"));
            }
            if ((rgb.length % 3) != 0) {
                throw new
                   IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam1"));
            }

            palette = (int[])(rgb.clone());
            paletteSet = true;
        }
Sets the RGB palette of the image to be encoded.
The <code>rgb</code> parameter contains alternating
R, G, B values for each color index used in the image.
The number of elements must be a multiple of 3 between
3 and 3*256.

<p> The 'PLTE' chunk will encode this information.

@param rgb An array of <code>int</code>s.
plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png/PNGEncodeParam.java