Can I detect old monitors and ship them with web safe colors?

I want to use unsafe colors in several places on my website, including for the background. But visitors with old computers bother me.

Can I use any code that changes color from an unsafe color to the nearest web safe color if the visitor cannot see the unsafe colors?

+4
source share
3 answers

Since this question cannot, as far as I know, answer simple HTML, I am posting this JavaScript solution to offer an alternative means:

You can use screen.colorDepth to return the color depth in bits of a custom screen. Except for the erroneous / erroneous implementation in Firefox 3.x and 4.1 (beta).

 var theImg = document.getElementsByTagName('img')[0]; if (screen.colorDepth < 32) { theImg.src = 'http://davidrhysthomas.co.uk/img/the_shat.png'; } else { theImg.src = 'http://davidrhysthomas.co.uk/img/terry_thomas.png'; } alert(screen.colorDepth); 

Adding to the PPK, Chromium 11 / Ubuntu 11.04 also returns 24 , not 32 , so Firefox may have been right.

JS Fiddle demo .

Link:

+4
source

I could be wrong here, but the point of colors safe for use on the Internet was such that your images would look the same on a monitor with a lower color depth (for example, 8-bit color), as well as on one with a higher color depth (16 / 24-bit color). What happens because all these colors should (theoretically) be displayed in all color formats.

If you have an image that is not “safe for a website” and you view it in an 8-bit color system, all colors that do not match the display color capabilities should automatically display as the closest color that suits. Basically, you do not need to "convert" it. The bit-depth color does not allow any OTHER colors to be displayed, and so it will have to connect to something that should be the next closest display color.

However, colors that are safe to use on the Internet are times when only 8-bit color is used on displays. I don’t think that you really need to worry now if you don’t know that your audience uses very, very old technologies.

+1
source

The browser will automatically do this if you use hexadecimal / color codes rather than images. And with the images, they just go crazy, gracefully humiliating their experience without work.

http://www.limov.com/colour/when-to-use-the-web-safe-palette.lml

0
source

All Articles