@Override
    public int getPaletteIndex(final int rgb) {
        for (int i = 0; i < palette.length; i++) {
            if (palette[i] == rgb) {
                return i;
            }
        }
        return -1;
    }
Constructs a new instance.

@param palette palette to copy and store.
src/main/java/org/apache/commons/imaging/palette/SimplePalette.java