I only could find very round-about ways for determining whether a display is greyscale. Like drawing something colored in a HTML canvas element on the page, and then reading back the pixels to see if they are all grey (i.e. have R=G=B).
Getting to know which device you are running on seems to be impossible for security reasons. It is possible to get the userAgent string that the browser sends to the server in the request headers, though. Which is the thing your PHP script retrieves. Normally the computer type is not specified in that string (just OS and browser), but apparently the e-readers are an exception to this. So perhaps I can get this to work in JavaScript as well.
[Edit] I now put in the code
var ua = navigator.userAgent;
ua = ua.search(/(kindle|likebook|meebook|boox|onyx|pocketbook|inkpad)/i);
if(ua >= 0) useMarkers = 2, realColor = startColor = '#E0E0E0', light = '#FFFFFF', hicol = '#808080'; // assume grey-scale display
For my desktop things still look normal. Please try what it does on the Kindle.
I only could find very round-about ways for determining whether a display is greyscale. Like drawing something colored in a HTML canvas element on the page, and then reading back the pixels to see if they are all grey (i.e. have R=G=B).
Getting to know which device you are running on seems to be impossible for security reasons. It is possible to get the userAgent string that the browser sends to the server in the request headers, though. Which is the thing your PHP script retrieves. Normally the computer type is not specified in that string (just OS and browser), but apparently the e-readers are an exception to this. So perhaps I can get this to work in JavaScript as well.
[Edit] I now put in the code
For my desktop things still look normal. Please try what it does on the Kindle.