Get the color resolution of your screen:
let depth = screen.pixelDepth;
Try it Yourself »
More "Try it Yourself" examples below.
The pixelDepth
property returns the screen's color depth.
The pixelDepth
property returns the color depth in bits per pixel.
The pixelDepth
property is read-only.
The screen.colorDepth property
The pixelDepth property is not supported in Internet Explorer 9 and earlier.
However, pixelDepth and colorDepth returns the same value.
Since all browsers support colorDepth, use that property instead.
screen.pixelDepth
Type | Description |
A number | The color resolution in bits per pixel: 1, 4, 8, 15, 16, 24, 32, or 48. |
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;
Try it Yourself »
screen.pixelDepth
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!