JavaScript Reference/Javascript Properties/colorDepth

Материал из Web эксперт
Перейти к: навигация, поиск

"colorDepth" Example

   <source lang="javascript">
   

<html> <head> <script language="JavaScript">

   function function1() {
       var m = screen.colorDepth;
       alert("The color depth of the screen is "+m+" bits per pixel"); 
   } 

</script> </head> <body bgcolor="#EEEEEE" ondblclick="function1();"> </body> </html>


     </source>
   
  


"colorDepth" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |screen | +----------------+--------------------------------------------------------------+

     </source>
   
  


"colorDepth" Possible Values

   <source lang="javascript">

Possible Values An integer representing the number of bits per pixel: 1, 4, 8, 15, 16, 24, or 32.


     </source>
   
  


"colorDepth" Syntax and Note

   <source lang="javascript">

Note: Read-only property. Returns the screen color depth.

Syntax:

screen.colorDepth


     </source>