Skip to content

Instantly share code, notes, and snippets.

@ab
Last active July 8, 2024 19:01
Show Gist options
  • Save ab/ef2448ff641266b750f66b72b5535d80 to your computer and use it in GitHub Desktop.
Save ab/ef2448ff641266b750f66b72b5535d80 to your computer and use it in GitHub Desktop.
Monitor test page: set various solid color backgrounds to check for dead/stuck pixels
<!doctype html>
<html>
<head>
<style type="test/css">
body {
background: #fff;
}
</style>
<script type="text/javascript">
const colors = ["#fff", "#aaa", "#333", "#000", "#f00", "#0f0", "#00f"];
var colorIndex = 0;
window.onclick = function() {
colorIndex++;
if (colorIndex >= colors.length) {
colorIndex = 0;
}
var color = colors[colorIndex];
console.log("Setting color to " + color);
document.body.style.backgroundColor = color;
}
</script>
</head>
<body>
<!--
See also:
- http://www.lagom.nl/lcd-test/
- https://www.eizo.be/monitor-test/
-->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment