> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# カラー パレット

> Color Palette

# Color Palette

レイアウト内で参照できる、再利用可能な色のコレクション。

## プロパティ

`default` - *object*、*省略可*。[color reference](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-colorreference) を使用して参照できる [Hexadecimal color](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-hexcolor) 定義のコレクション。

`highContrast` - *object*、*省略可*。[color reference](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-colorreference) を使用して参照できる [Hexadecimal color](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-hexcolor) 定義のコレクション。[ハイ コントラスト モード](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-tak-high-contrast-mode.md) が有効な場合、`default` の定義をオーバーライドします。

## サンプル

```JSON theme={null}
{
  "$schema": "https://raw.githubusercontent.com/microsoft/xbox-game-streaming-tools/main/touch-adaptation-kit/schemas/layout/4.0/layout.json",
  "styles": {
    "colors": {
      "default": {
        "myColor1": "#ff0000ff",
        "myColor2": "#00ff00ff",
        "system_contentPrimary": "#0000ffff"
      },
      "highContrast": {
        "myColor1": "#00ff00ff",
        "system_contrastPrimary": "#0000ffaa"
      }
    }
  },
  "content": {
    "left": {
      "inner": [
        {
          "type": "directionalPad",
          "styles": {
            "idle": {
              "background": {
                "type": "color",
                "value": "colors/myColor1"
              }
            }
          }
        }
      ]
    },
    "right": {
      "inner": [
          {
              "type": "button",
              "action": "gamepadY"
          },
          {
              "type": "button",
              "action": "gamepadB"
          },
          {
              "type": "button",
              "action": "gamepadA",
              "styles": {
                "idle": {
                  "background": {
                    "type": "color",
                    "value": "colors/myColor2"
                  }
                }
              }
          },
          {
              "type": "button",
              "action": "gamepadX"
          }
      ]
    }
  }
}
```

上記のレイアウトは、ハイ コントラスト モードが **無効** な場合:

![カラー パレットでハイ コントラスト モードが無効なタッチ レイアウト](https://mintcdn.com/microsoft-4404708b/-_0FrcE2bDxzGxv-/images/gdk/reference/game-streaming-tak-color-palette-reference-hc-disabled.png?fit=max\&auto=format\&n=-_0FrcE2bDxzGxv-\&q=85\&s=dba732004eecd1db8fc9a608c31248cd)

そしてハイ コントラスト モードが **有効** な場合:

![カラー パレットでハイ コントラスト モードが有効なタッチ レイアウト](https://mintcdn.com/microsoft-4404708b/-_0FrcE2bDxzGxv-/images/gdk/reference/game-streaming-tak-color-palette-reference-hc-enabled.png?fit=max\&auto=format\&n=-_0FrcE2bDxzGxv-\&q=85\&s=fff468e0eba734e9edec6527e7584262)

## 補足

上記の[サンプル](#sample) には、[システム カラー](#system-colors) (例: `system_contentPrimary`、`system_accentPrimary` など) をオーバーライドする色定義に加え、カスタム色定義 (`myColor1`、`myColor2`) が含まれています。コントロールは、スタイル設定時に **暗黙的に** システム カラーをサンプリングします。つまり、オーバーライドは (コントロールがカスタム `styles` ブロック内に独自のオーバーライドを持たない限り) すべてのコントロールのグローバル スタイル設定に影響します。カスタム カラーは、[color reference](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/types/game-streaming-touch-colorreference) を使用して **明示的に** 参照する必要があります (例: `colors/myColor1`)。さらに、カスタム色定義は、システム カラー用に予約されている `system_` プレフィックスを **使用できません**。

色定義は `default` および `highContrast` オブジェクトで宣言され、それぞれ [ハイ コントラスト モード](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-tak-high-contrast-mode.md) が無効または有効な場合に有効化されます。ハイ コントラスト モードが無効な場合、色は `default` からサンプリングされます。有効な場合、色は最初に `highContrast` からサンプリングされ、定義がなければ `default` にフォールバックします。システム カラーのオーバーライドが `default` に存在しない場合、システムの既定値が使用されます。一方、カスタム カラーは `default` で定義 **必須** です。次の表は、高コントラスト (HC) モードが有効かどうかに応じて、上記の色定義がどのように解決されるかを示しています:

| 色定義 | HC モード無効 | HC モード有効 |
| :- | - | - |
| myColor1 | `#ff0000ff` | `#00ff00ff` |
| myColor2 | `#00ff00ff` | `#00ff00ff` |
| system\_contentPrimary | `#0000ffff` | `#0000ffff` |
| system\_contrastPrimary | システム既定値 | `#0000ffaa` |

## システム カラー

次の表は、Touch Adaptation Kit のシステム カラー一覧、コントロールのスタイル設定に使用される方法の説明、および高コントラスト (HC) モードが無効/有効な場合のシステム既定値をまとめたものです。

| システム カラー | 説明 | HC モード無効 | HC モード有効 |
| :- | :- | :- | :- |
| system\_contentPrimary | 中央のストローク、アイコンの色合い、dpad のグラデーションなどのコンポーネントのスタイル設定に使用される色。 | `#ffffffff` | `#ffffffff` |
| system\_contentSecondary | 背景や塗りつぶしなどのコンポーネントのスタイル設定に使用される色。 | `#ffffff1a` | `#ffffffff` |
| system\_contrastPrimary | 内側/外側のストロークや face image の背面板などのコントラスト コンポーネントのスタイル設定に使用される色。 | `#00000000` | `#000000bf` |
| system\_contrastSecondary | タッチパッドのストロークなどのコントラスト コンポーネントのスタイル設定に使用される色。 | `#00000000` | `#ffffffff` |
| system\_actionColorDefault | `action` フィールドが gamepad 以外のアクションに設定されているコントロール上のコンポーネントのスタイル設定に使用される色。 | `#ffffffff` | `#ffffffe6` |
| system\_actionColorA | `action` フィールドが `gamepadA` に設定されているコントロール上のコンポーネントのスタイル設定に使用される色。 | `#7eb902ff` | `#ffffffe6` |
| system\_actionColorB | `action` フィールドが `gamepadB` に設定されているコントロール上のコンポーネントのスタイル設定に使用される色。 | `#f25127ff` | `#ffffffe6` |
| system\_actionColorX | `action` フィールドが `gamepadX` に設定されているコントロール上のコンポーネントのスタイル設定に使用される色。 | `#00a2eeff` | `#ffffffe6` |
| system\_actionColorY | `action` フィールドが `gamepadY` に設定されているコントロール上のコンポーネントのスタイル設定に使用される色。 | `#ffb807ff` | `#ffffffe6` |
| system\_accentPrimary | ergo-edit inner wheel などのコンポーネントのスタイル設定に使用される色。 | `#8cc08cff` | `#8cc08cff` |
| system\_accentSecondary | ergo-edit outer wheel などのコンポーネントのスタイル設定に使用される色。 | `#61ab61ff` | `#61ab61ff` |

最新の一覧については、[最新スキーマ](https://github.com/microsoft/xbox-game-streaming-tools/blob/main/touch-adaptation-kit/schemas/layout/v4.0/layout.json) 内の `_SystemColor` プレフィックスの定義を参照してください。

## 関連項目

[Touch Adaptation Kit リファレンス](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-touch-touch-adaptation-kit-overview.md)\
[タッチ アダプテーション レイアウト用のハイ コントラスト モード](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-tak-high-contrast-mode.md)


## Related topics

- [Touch Adaptation Kit](https://devdocs.xbox.com/ja-jp/reference/system/touchadaptationkit/touchadaptationkit-reference.md)
- [タッチ適応レイアウトのハイ コントラスト モード](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-tak-high-contrast-mode.md)
- [Touch Adaptation Kit Editor: プレビューのカスタマイズ](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/tak-editor/game-streaming-tak-editor-customize-preview.md)
- [Touch Adaptation Kit Editor: セットアップ](https://devdocs.xbox.com/ja-jp/build/core-features/common/game-streaming/tak-editor/game-streaming-tak-editor-setup.md)
- [XAppCaptureVideoColorFormat](https://devdocs.xbox.com/ja-jp/reference/system/xappcapture/enums/xappcapturevideocolorformat.md)
