The 4096 colors supported on devices are not an indexed palette but a direct color model. As such, each color component (R, G, B) is represented by 4 bits (0-15). To check if a color is displayed as it will be on devices with 4096 colors use :
boolean valid = (color & 0x0f0f0f) == 0;
if valid is false, the four least significant bits of the color specified were non-zero, and the color will be truncated upon display (which usually isnt a problem since it'll simply mean the color will be displayed as if the least significant bits were zero). Also, if you use Sun's WTK 1.X, be aware that the dithering performed in those emulators is not an accureate representation of how it will look on phones. I have yet to run into a MIDP device that dithers instead of truncating the color components as described above.