Window screen.pixelDepth property
- Previous page height
- Next page width
- Go up one level Window Screen
Definition and usage
pixelDepth
The property returns the color depth of the screen.
pixelDepth
The property returns the color depth in bits per pixel.
pixelDepth
The property is read-only.
See also:
screen.colorDepth property
Tip:
Internet Explorer 9 and earlier versions do not support pixelDepth
property.
However,pixelDepth
and colorDepth
Return the same value.
Since all browsers support colorDepth
, please use this property instead.
Instance
Example 1
Get the screen color resolution:
let depth = screen.pixelDepth;
Example 2
All screen properties:
let text = "Total width/height: " + screen.width + "*" + screen.height + "<br>" "Available width/height: " + screen.availWidth + "*" + screen.availHeight + "<br>" "Color depth: " + screen.colorDepth + "<br>" "Color resolution: " + screen.pixelDepth;
Syntax
screen.pixelDepth
Return value
Type | Description |
---|---|
Number |
Color resolution per pixel bit: 1, 4, 8, 15, 16, 24, 32, or 48. |
Browser support
All browsers support screen.pixelDepth
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Supported | Supported | Supported | Supported | Supported | Supported |
Related pages
- Previous page height
- Next page width
- Go up one level Window Screen