jpskill.com
🛠️ 開発・MCP コミュニティ

contrast-check

UIデザインやウェブサイトの配色における文字と背景色のコントラスト比をチェックし、アクセシビリティの国際基準であるWCAGに準拠しているかを確認、基準を満たすように修正を提案するSkill。

📜 元の英語説明(参考)

Check color contrast ratios for WCAG accessibility compliance. Use when: auditing UI components for accessibility, validating color schemes meet AA/AAA standards, fixing low-contrast text in designs.

🇯🇵 日本人クリエイター向け解説

一言でいうと

UIデザインやウェブサイトの配色における文字と背景色のコントラスト比をチェックし、アクセシビリティの国際基準であるWCAGに準拠しているかを確認、基準を満たすように修正を提案するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o contrast-check.zip https://jpskill.com/download/14786.zip && unzip -o contrast-check.zip && rm contrast-check.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14786.zip -OutFile "$d\contrast-check.zip"; Expand-Archive "$d\contrast-check.zip" -DestinationPath $d -Force; ri "$d\contrast-check.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して contrast-check.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → contrast-check フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
3

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Contrast Check

概要

WCAG 2.1 のコントラスト要件に基づいて、色の組み合わせをチェックします。16進カラーを渡すと、通常テキストと大きなテキストの両方について、AA/AAA の合否結果とともにコントラスト比が得られます。

  • テキストの色が背景色に対して読みやすいかどうかを確認します
  • カラーパレット全体のアクセシビリティ準拠を監査します
  • デザインから抽出された色が WCAG 基準を満たしているか検証します

手順

  1. 16進カラーのリストを引数として受け取ります
  2. すべての前景色/背景色の組み合わせについてコントラスト比を計算します
  3. 各組み合わせを、通常テキストと大きなテキストに対する WCAG 2.1 AA および AAA の閾値に対してテストします

WCAG の閾値:

  • AA 通常テキスト — 比率 >= 4.5:1
  • AA 大きなテキスト — 比率 >= 3:1
  • AAA 通常テキスト — 比率 >= 7:1
  • AAA 大きなテキスト — 比率 >= 4.5:1

2つ以上の16進カラー(# プレフィックスの有無にかかわらず)を指定してスクリプトを実行します。

bash <skill-path>/scripts/contrast-check.sh <color1> <color2> [color3] [color4] ...

スクリプトは、コントラスト比と合否結果を含む JSON を出力します。

{
  "pairs": [
    {
      "foreground": "#1a1a2e",
      "background": "#ffffff",
      "ratio": 16.57,
      "aa": { "normal": true, "large": true },
      "aaa": { "normal": true, "large": true }
    }
  ],
  "summary": {
    "totalPairs": 2,
    "passAA": 1,
    "passAAA": 1,
    "failAA": 1
  }
}

チェック後、次の表をユーザーに提示します。

Contrast Check Results:

  #1a1a2e on #ffffff — 16.57:1 — AA: Pass — AAA: Pass
  #e94560 on #ffffff —  3.94:1 — AA: Fail (normal) / Pass (large) — AAA: Fail

Summary: 1/2 pairs pass AA for normal text, 1/2 pass AAA.

失敗した組み合わせにはフラグを立て、閾値に達するように色を濃く/薄くするなどの修正を提案します。

例 1: ダークテーマのヘッダーを白いテキストに対してチェックする

bash <skill-path>/scripts/contrast-check.sh "#1a1a2e" "#ffffff"

出力:

{
  "pairs": [
    {
      "foreground": "#1a1a2e",
      "background": "#ffffff",
      "ratio": 16.57,
      "aa": { "normal": true, "large": true },
      "aaa": { "normal": true, "large": true }
    }
  ],
  "summary": { "totalPairs": 1, "passAA": 1, "passAAA": 1, "failAA": 0 }
}

例 2: ブランドパレット全体を監査する

bash <skill-path>/scripts/contrast-check.sh "#1a1a2e" "#e94560" "#ffffff" "#3d83f7" "#bdbdbd"

スクリプトは、すべての前景色/背景色の組み合わせをチェックし、どの組み合わせが AA または AAA に失敗するかを報告します。たとえば、#e94560#ffffff の組み合わせは 3.94:1 の比率になり、通常テキストでは AA に失敗しますが、大きなテキストでは合格します。

ガイドライン

  • 色は有効な16進値である必要があります(3桁または6桁、# の有無にかかわらず)。
  • image-analysis skill と組み合わせて、最初にデザインから色を抽出し、次に16進値をこの skill にパイプしてアクセシビリティを監査します。
  • 組み合わせが失敗した場合は、ターゲットの比率を満たすように、いずれかの色を濃くするか薄くすることを提案します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Contrast Check

Overview

Check color pairs against WCAG 2.1 contrast requirements. Pass in hex colors and get contrast ratios with AA/AAA pass/fail results for both normal and large text.

  • Checking if a text color is readable against a background color
  • Auditing an entire color palette for accessibility compliance
  • Verifying colors extracted from a design meet WCAG standards

Instructions

  1. Takes a list of hex colors as arguments
  2. Computes the contrast ratio for every foreground/background pair
  3. Tests each pair against WCAG 2.1 AA and AAA thresholds for normal and large text

WCAG thresholds:

  • AA normal text — ratio >= 4.5:1
  • AA large text — ratio >= 3:1
  • AAA normal text — ratio >= 7:1
  • AAA large text — ratio >= 4.5:1

Run the script with two or more hex colors (with or without # prefix):

bash <skill-path>/scripts/contrast-check.sh <color1> <color2> [color3] [color4] ...

The script outputs JSON with contrast ratios and pass/fail results:

{
  "pairs": [
    {
      "foreground": "#1a1a2e",
      "background": "#ffffff",
      "ratio": 16.57,
      "aa": { "normal": true, "large": true },
      "aaa": { "normal": true, "large": true }
    }
  ],
  "summary": {
    "totalPairs": 2,
    "passAA": 1,
    "passAAA": 1,
    "failAA": 1
  }
}

After checking, present a table to the user:

Contrast Check Results:

  #1a1a2e on #ffffff — 16.57:1 — AA: Pass — AAA: Pass
  #e94560 on #ffffff —  3.94:1 — AA: Fail (normal) / Pass (large) — AAA: Fail

Summary: 1/2 pairs pass AA for normal text, 1/2 pass AAA.

Flag any failing pairs and suggest fixes (darken/lighten the color to reach the threshold).

Examples

Example 1: Check a dark theme header against white text

bash <skill-path>/scripts/contrast-check.sh "#1a1a2e" "#ffffff"

Output:

{
  "pairs": [
    {
      "foreground": "#1a1a2e",
      "background": "#ffffff",
      "ratio": 16.57,
      "aa": { "normal": true, "large": true },
      "aaa": { "normal": true, "large": true }
    }
  ],
  "summary": { "totalPairs": 1, "passAA": 1, "passAAA": 1, "failAA": 0 }
}

Example 2: Audit a full brand palette

bash <skill-path>/scripts/contrast-check.sh "#1a1a2e" "#e94560" "#ffffff" "#3d83f7" "#bdbdbd"

The script checks all foreground/background combinations and reports which pairs fail AA or AAA. For example, #e94560 on #ffffff yields a ratio of 3.94:1 which fails AA for normal text but passes for large text.

Guidelines

  • Colors must be valid hex values (3 or 6 digits, with or without #).
  • Pair with the image-analysis skill to extract colors from a design first, then pipe the hex values into this skill to audit accessibility.
  • When a pair fails, suggest darkening or lightening one of the colors to meet the target ratio.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。