Agent skill UI design
Color
Work with color, contrast or theme choices for a web interface.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add raphaelsalaja/skills --skill color --agent claude-code --yesCheck this file in your project.claude/skills/color/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add raphaelsalaja/skills --skill colorSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. A running form with light and dark themes and browser tools that evaluate scripts.
View operation manualWhat this skill helps with
- Work with color, contrast or theme choices for a web interface.
Good for
- Palettes and themes
- Publisher
- Raphael Salaja
- Shipped tools or recipes
- contrast.js
- Result
- A list of confirmed rendered contrast measurements and the corresponding role tokens.
- Skill name
color- Repository
raphaelsalaja/skills
Common pitfall
Avoid this prompt
Compare our token hex values and mark the whole form accessible.
Opacity, raised surfaces, and theme overrides can change the rendered color. The helper also reports surfaces requiring manual checks.
Use these steps
- Identify labels, placeholders, borders, and the color roles used by each theme.
- Run the browser helper and confirm each reported failure in its rendered state.
- Record verified ratios and surface limits, then retest any authorized token changes.
Hands-on walkthrough
Find contrast failures in the rendered form and link confirmed results to semantic color tokens.
Find contrast failures in the rendered form and link confirmed results to semantic color tokens.
Map surfaces and states
Identify labels, placeholders, borders, and the color roles used by each theme.
Prompt · Step 1Use the Color skill on [route and form]. Open the form in each supported theme and identify label text, placeholders, necessary control edges, and meaningful icons. Record their semantic tokens and the real surfaces behind them. Include increased contrast if offered by the project.Measure rendered contrast
Run the browser helper and confirm each reported failure in its rendered state.
Prompt · Step 2Evaluate the installed contrast.js in the running page, setting window.__colorOptions = { root } to the actual form element if needed. Check findings and unverified separately. Confirm candidates against a zoomed crop and composited colors. Use 4.5:1 for normal text and 3:1 for large text and the adjacent colors of required controls or meaningful icons. Use measured.lc as supplementary context for text.Report by theme and token
Record verified ratios and surface limits, then retest any authorized token changes.
- Ratios are measured after compositing in every named theme.
- Unverified surfaces and threshold failures remain visible in the report.
Prompt · Step 3Report one row per cause with theme, state, role token, composited foreground and background, measured ratio, threshold, and crop. Inspect image-backed labels or unresolved placeholders manually and mark checks you cannot complete. If fixes are authorized, use the nearest appropriate passing role token and rerun the same states in each theme.
Workflow lookup
Find the local files and calls used in the walkthrough.
Measure one formIncluded
- Command or reference
contrast.js · window.__colorOptions = { root }- Examples
- Use a real DOM element as root and read findings and unverified from evaluation.
Inspect candidate colorsIncluded
- Command or reference
measured.ratio · measured.suggestion · measured.lc- Examples
- Read suggestion as a candidate for role-token selection, and confirm the final usage in each theme.
FAQ
How should Lc be used alongside the WCAG ratio?
Use the WCAG ratio for the relevant threshold. This helper includes Lc as a separate lightness contrast reading for text, which can help compare already passing dark-theme options.
Where are the installed files?
Open the project skill directory reported by the installer. The files referenced by this walkthrough sit alongside the skill’s SKILL.md.