Javascript Reference
Categories: screen

javascript screen pixelDepth

@March 15, 2008, 1:22 a.m.
pixelDepthFirefox/Netscape/NN 4 IE n/a Chrome/Safari/DOM n/a  

Read-only  

Returns the number of bits per pixel used to display color in the video monitor. This value is similar to the colorDepth property, but it is not influenced by a potential custom color palette, as colorDepth is.

 
Example
 
if (screen.pixelDepth > 8) {
    document.getElementById("pretty").color = "cornflowerblue";
} else {
    document.getElementById("pretty").color = "blue";
}
 
Value

Integer.

 
Default

Current video control panel setting.


Powered by Linode.