Sử dụng screen.colorDepth để lấy số bit trên pixel dùng để hiển thị màu (thường bằng pixelDepth).
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 màu: " + screen.colorDepth);
</script>
</body>
</html>