public int getNearestColorIndex(int red, int green, int blue) {
    		return invColorMap[(((red >> bitsDiscarded) << (bitsReserved<<1))) | 
    					 ((green >> bitsDiscarded) << bitsReserved) |
    					 (blue >> bitsDiscarded)]&0xff;
    	}
Internal method to test if a number is prime.
Not an efficient algorithm.
@param n the number to test.
@return the result of the test.
subs/gif-revert/src/main/java/com/engineer/gif/revert/lib/AnimatedGIFWriter.java