javascript screen colorDepth

colorDepthNN 4 IE 4 DOM n/a  

Read-only  

Returns the number of bits per pixel used to display color in the video monitor or image buffer. Although this property is read-only, its value can be influenced by settings of the bufferDepth property (IE only). You can determine the color depth of the current video screen and select colors accordingly.

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

Integer.

 
Default

Current video control panel setting.


1691,Nickname,Homepage or email,Comments here,Add comment