The lowest common denominator color palette we must expect is 8-bit, or 256, color resolution. Even so, doing this is necessary if you want your colors to display correctly across platforms and browsers.
Some differences are very subtle, while others are outrageously vast.
There is a solution that aids the developer to ensure, as much as is possible, that the colors intended will actually appear correctly on every platform and all browsers. One can download the Non-Dithering Web Palette from the Adobe site and use it in Photoshop, or specifying the respective colors in another image manipulation application. Unfortunately, this really only works well with GIFs, which are limited to 256 colors anyway. JPEGs require many more colors to be rendered and will not look particularly good on an 8-bit monitor.