// Check the color depth of the screen
if (window.screen.colorDepth < 8) {
// Use low-color version of page
} else {
// Use regular, colorful page
}Screen: colorDepth property / notebook
Screen: colorDepth property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.