diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/screen/pixeldepth | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/screen/pixeldepth')
| -rw-r--r-- | files/zh-cn/web/api/screen/pixeldepth/index.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/screen/pixeldepth/index.html b/files/zh-cn/web/api/screen/pixeldepth/index.html new file mode 100644 index 0000000000..c96b7e4253 --- /dev/null +++ b/files/zh-cn/web/api/screen/pixeldepth/index.html @@ -0,0 +1,51 @@ +--- +title: Screen.pixelDepth +slug: Web/API/Screen/pixelDepth +tags: + - API +translation_of: Web/API/Screen/pixelDepth +--- +<div>{{APIRef("CSSOM View")}}</div> + +<h2 id="Summary" name="Summary">概述</h2> + +<p>返回屏幕的位深度/色彩深度(bit depth)。根据CSSOM( CSS对象模型 )视图,为兼容起见,该值总为24。</p> + +<h2 id="Syntax" name="Syntax">语法</h2> + +<pre class="syntaxbox">depth = window.screen.pixelDepth +</pre> + +<h2 id="Example" name="Example">示例</h2> + +<pre class="brush:js">// 如果没有足够的位深度/色彩深度(bit depth),就选择一个更纯的颜色 +if ( window.screen.pixelDepth > 8 ) { + document.style.color = "#FAEBD7"; +} else { + document.style.color = "#FFFFFF"; +} +</pre> + +<h2 id="Specification" name="Specification">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{ SpecName('CSSOM View', '#dom-screen-pixeldepth', 'Screen.pixelDepth') }}</td> + <td>{{ Spec2('CSSOM View') }}</td> + </tr> + </tbody> +</table> + +<h2 id="See_also" name="See_also">相关链接</h2> + +<ul> + <li>{{domxref("Screen.colorDepth")}}</li> +</ul> |
