Check out Atomic Chess, our featured variant for November, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Vanguard Chess. Game on 16x16 board, with 48 pieces per player. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on Sat, Nov 18, 2023 03:19 PM UTC in reply to H. G. Muller from 02:59 PM:

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.