Screen pixelDepth Property
Example
Get the color resolution of your screen:
var x = "Color Resolution: " + screen.pixelDepth;
The result of x will be:
Try it yourself »
More "Try it Yourself" examples below.
Definition and Usage
The pixelDepth property returns the color resolution (in bits per pixel) of the visitor's screen.
Tip: The pixelDepth property is not supported in Internet Explorer 9 and earlier versions. However, the colorDepth property represents the same thing as the pixelDepth property. Since all major browsers support colorDepth, use that property instead.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
pixelDepth | Yes | 10 | Yes | Yes | Yes |
Syntax
screen.pixelDepth
Technical Details
Return Value: | A Number, representing the color resolution, in bits per pixel. Possible values:
|
---|
More Examples
Example
All screen properties in one example:
var txt = "";
txt += "<p>Total width/height: " + screen.width + "*" +
screen.height + "</p>";
txt += "<p>Available width/height: " +
screen.availWidth + "*" + screen.availHeight + "</p>";
txt += "<p>Color
depth: " + screen.colorDepth + "</p>";
txt += "<p>Color resolution: " +
screen.pixelDepth + "</p>";
Try it yourself »
Screen Object