screen.colorDepth 사용 JavaScript의 속성을 사용하여 창 화면에 색상을 표시하는 데 사용되는 비트 수를 반환합니다.
예시
다음 코드를 실행하여 JavaScript에서 화면 색상 깊이를 반환할 수 있습니다.
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Screen width: " + screen.width);
document.write("<br>Screen height: " + screen.height);
document.write("<br>Color Depth: " + screen.colorDepth);
</script>
</body>
</html>