color-accessibility
Skill1 starsChanged 3 months agoMITView on GitHub
Trigger on: check contrast, WCAG contrast, accessible colors, readable text color, fix low-contrast, dimmed text color, palette accessibility, pastel color, textcolor for background, make this color readable, UI theme contrast, Neovim highlight contrast. Evaluate, fix, and generate accessible fg/bg pairs with the pastel CLI and color-accessibility/main.py (WCAG AA/AAA). Use whenever the user changes colors for UI, CSS, terminal, or editor themes — do not guess contrast; measure it.
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- SkillMedev/designer-to-dev-handofftheir own version, first seen Oct 5, 2026
- SkillMedev/design-system-buildertheir own version, first seen Oct 5, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- SkillMedev/designer-to-dev-handoff★ 1same name
- SkillMedev/design-system-builder★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- alloy-structural-analysisSkill
- analyzing-architectureSkill
- daily-briefingSkill
- design-docSkill
- diagramSkill
- eng-career-goals-writerSkill
- gh-repo-managementSkill
- git-commit-helperSkill
- jiraSkill
- jqSkill
- morphirSkill
- newrelic-cliSkill
- oli-storage-managerSkill
- project-instructorSkill
- qmd-searchSkill
- rigorous-reviewSkill
- save-zkSkill
- scalaSkill
- smart-initSkill
- sourcegraph-searchSkill
- structured-memorySkill
- visualizeSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
If pastel is missing: tell the user to install (brew install pastel or cargo install pastel) and STOP.
- Distinctive: line 86
Do not hand-pick hex. Prefer:
- Distinctive: line 93
Prefer the textcolor / high-ratio result (often black or white, frequently AAA).
- Distinctive: line 94
Do not scrape the nearest gray that barely clears 4.5:1 unless the user asked to preserve a gray look.
- Very specific: line 126
Never claim WCAG pass without a Phase 2 (or post-fix) main.py result in this turn.
- Distinctive: line 143
Gradient text: check against the lightest and darkest stops under the glyphs.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Color Accessibility
Prove every fg/bg pair with math before shipping colors. pastel has no contrast subcommand — use main.py in this skill directory for ratios; use pastel for manipulation (textcolor, mix, darken, lighten, format).
When to use / not use
- Use: contrast checks, picking text on a fill, fixing failing pairs, dimmed/inactive text, theme palette audit.
- Do not use: brand-only palette vibes with no readability ask; full diagram authoring (use diagram — it has its own contrast step).
Work phases in order. Do not skip. Do not invent ratios from memory.
Prerequisites
pastel --version # required on PATH
python3 color-accessibility/main.py --helpIf pastel is missing: tell the user to install (brew install pastel or cargo install pastel) and STOP.
Resolve main.py relative to this skill directory (or the path you loaded the skill from).
Thresholds (default)
| Role | Min ratio | Notes |
| Normal text / UI labels | 4.5:1 (AA) | Prefer 7:1 (AAA) when easy |
| Large text (>=18pt / 14pt bold) | 3:1 (AA) | Pass --large-text |
| Dimmed / inactive | Still >= 3:1 vs bg; strictly below active text ratio | Hierarchy without illegibility |
Deeper WCAG notes: load references/wcag.md only if large-text, non-text UI, or AAA is disputed.
Phase 1 — Capture pairs
- List every fg/bg (or fill/font-color) pair the user cares about as hex or named colors.
- Completion: each pair has explicit fg and bg strings (no "something light gray").
Phase 2 — Measure (required)
For each pair:
python3 main.py contrast --fg '<fg>' --bg '<bg>'
# large text:
python3 main.py contrast --fg '<fg>' --bg '<bg>' --large-text- Exit 0 + "status":"success" -> meets default min.
- Exit 1 + "status":"fail" -> record ratio and continue to Phase 3.
- "status":"error" -> report reason and STOP (or fix input colors).
Optimal black/white fg for a background only:
python3 main.py textcolor --bg '<bg>'
# equivalent core: pastel textcolor '<bg>' | pastel format hexCompletion: every pair has a JSON result with ratio, level, passes_aa.
Phase 3 — Fix failures
Do not hand-pick hex. Prefer:
python3 main.py fix --fg '<fg>' --bg '<bg>' --adjust auto --min-ratio 4.5- auto: try pastel textcolor on bg first; else nudge fg lightness.
- Prefer the textcolor / high-ratio result (often black or white, frequently AAA). Do not scrape the nearest gray that barely clears 4.5:1 unless the user asked to preserve a gray look.
- --adjust fg|bg when the user freezes one side.
- Re-run contrast on the returned pair.fg / pair.bg.
Manual pastel knobs (when fix is wrong for the aesthetic):
pastel darken 0.1 '<color>' | pastel format hex
pastel lighten 0.15 '<color>' | pastel format hex
pastel desaturate 0.2 '<color>' | pastel format hexCompletion: every required pair passes_aa (or user explicitly accepted a documented exception).
Phase 4 — Dimmed / mixed roles
Inactive text = mix fg toward bg in a perceptual space (default Lab):
python3 main.py mix-dim --fg '<active_fg>' --bg '<bg>' --fraction 0.6
# fraction = pastel --fraction = how much of the *base fg* is kept (0-1)Then contrast the mixed color vs bg. If < 3:1, raise --fraction (keep more fg) or fix via Phase 3.
Completion: dim color hex + ratio; dim ratio < active ratio when both exist.
Phase 5 — Deliver
- Emit final hex pairs (and ratios) in the user's target format (CSS, Lua hl, JSON, table).
- Cite measured ratios next to each pair (e.g. 12.8:1 AAA).
- Never claim WCAG pass without a Phase 2 (or post-fix) main.py result in this turn.
Completion: user-ready snippet + no unverified pairs.
Commands cheat sheet
| Goal | Command |
| Ratio | python3 main.py contrast --fg ... --bg ... |
| Best fg | python3 main.py textcolor --bg ... |
| Auto-fix | python3 main.py fix --fg ... --bg ... --adjust auto |
| Dim mix | python3 main.py mix-dim --fg ... --bg ... --fraction 0.6 |
| Hex normalize | pastel format hex '<color>' |
Edge cases
- Transparent / alpha: flatten onto the real background first; do not contrast alpha hex alone.
- Gradient text: check against the lightest and darkest stops under the glyphs.
- Syntax themes: active vs comment/dimmed both need Phase 2; comments still >= 3:1.
- diagram skill: for D2 class fills, diagram/main.py check-contrast is enough inside diagram work.
Non-examples (do not load this skill alone)
- "Draw a C4 diagram of our services" -> diagram
- "What is the complementary hue of blue?" -> plain pastel complement is enough unless readability is in scope
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

