Sử dụng screen.pixelDepth để lấy độ sâu màu (bit trên pixel) của màn hình.
Ví dụ
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Chiều rộng màn hình: " + screen.width);
document.write("<br>Chiều cao màn hình: " + screen.height);
document.write("<br>Độ sâu pixel: " + screen.pixelDepth);
</script>
</body>
</html>