screen.colorDepth
JavaScript 1.2+, JScript 3+ Nav4+, IE4+ Syntax
screen.colorDepth
Description
The colorDepth property of the screen object accesses the maximum number of colors the user's screen can display. The returned value is in terms of bits.
Example
Listing 7.459 displays the color depth of the user's screen to the page.
Listing 7.459 Accessing the colorDepth Property of the screen Object
<script language="JavaScript1.2"> <!-- Hide document.write("The color depth of this user's screen is <b>"); document.write(screen.colorDepth + '</b> bit'); // End hide ---> </script> |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.