Screen.colorDepth
概述
返回屏幕的颜色深度(color depth)。根据CSSOM( CSS对象模型 )视图,为兼容起见,该值总为24。
语法
bitDepth = window.screen.colorDepth
示例
// 检测屏幕的颜色深度 if ( window.screen.colorDepth < 8) { // 使用低色彩版本页面 } else { // 使用常规的彩色版页面 }
规范
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module Screen.colorDepth |
Working Draft |