@Override
    public Iterator<Integer> iterator(){

        return new Iterator<Integer>(){
            private int currentColor = 0;

            @Override
            public boolean hasNext()
            {
                return currentColor <= maxVal;
            }

            @Override
            public Integer next()
            {
                int color = currentColor;
                int blue = color & channelMask;
                color >>= bitsPerChannel;
                int green = color & channelMask;
                color >>= bitsPerChannel;
                int red = color & channelMask;

                currentColor += 1;

                return (red << (16 + additionalShift)) | (green << (8 + additionalShift)) | (blue << additionalShift);
            }

            @Override
            public void remove()
            {
                throw new UnsupportedOperationException();
            }
        };
    }