Skip to content
Back to skills

Verify Contrast

ASecurity

Compute the WCAG contrast ratio from hex foreground/background values and check AA/AAA for normal and large text. Reach for this on any color question.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
ai-agents

Security analysis

A100/100

Scanned September 23, 2026

npx -y skills add mcorbett51090/RavenClaude --skill verify-contrast --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Verify Contrast?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Verify Contrast
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mcorbett51090-verify-contrast/badge)](https://www.skillsdirectory.com/skills/mcorbett51090-verify-contrast)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: verify-contrast
description: "Compute the WCAG contrast ratio from hex foreground/background values and check AA/AAA for normal and large text. Reach for this on any color question."
---

# Skill: Verify contrast

Contrast is a computed ratio, not a vibe — color approved on appearance routinely fails (§3 #5).

## Step 1 — Take the hex values
Foreground and background as hex strings.

## Step 2 — Compute relative luminance
sRGB linearization then L = 0.2126R + 0.7152G + 0.0722B per channel.

## Step 3 — Compute the ratio
(L_light + 0.05) / (L_dark + 0.05) via `accessibility_calc.py contrast` (§3 #5).

## Step 4 — Check the thresholds
AA normal >=4.5, AA large >=3.0, AAA normal >=7.0, AAA large >=4.5.

## Output
A computed contrast ratio with AA/AAA pass for normal and large text — never an eyeballed judgment.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…