From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/screen/pixeldepth/index.html | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/ja/web/api/screen/pixeldepth/index.html (limited to 'files/ja/web/api/screen/pixeldepth') diff --git a/files/ja/web/api/screen/pixeldepth/index.html b/files/ja/web/api/screen/pixeldepth/index.html new file mode 100644 index 0000000000..b32a3908e1 --- /dev/null +++ b/files/ja/web/api/screen/pixeldepth/index.html @@ -0,0 +1,60 @@ +--- +title: Screen.pixelDepth +slug: Web/API/Screen/pixelDepth +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference + - screen +translation_of: Web/API/Screen/pixelDepth +--- +

{{APIRef("CSSOM")}}

+ +

画面のビット深度を返します。CSSOM により、互換性の理由から 24 を返す実装もあります。そうでないものについては、{{anch("Browser compatibility", "ブラウザーの互換性")}}の節を参照してください。

+ +

構文

+ +
let depth = window.screen.pixelDepth
+ +

+ +
// if there is not adequate bit depth
+// choose a simpler color
+if ( window.screen.pixelDepth > 8 ) {
+  document.style.color = "#FAEBD7";
+} else {
+  document.style.color = "#FFFFFF";
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSSOM View', '#dom-screen-pixeldepth', 'Screen.pixelDepth')}}{{Spec2('CSSOM View')}}初回定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.pixelDepth")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf