Skip to content

Add Contrast Checker tool - #15

Merged
02karthik merged 2 commits into
mainfrom
claude/wizardly-mayer-wwjuri
Aug 6, 2026
Merged

Add Contrast Checker tool#15
02karthik merged 2 commits into
mainfrom
claude/wizardly-mayer-wwjuri

Conversation

@02karthik

Copy link
Copy Markdown
Collaborator

What is this tool?

Contrast Checker — pick a text colour and a background colour (native swatch or hex), and instantly see the WCAG contrast ratio, per-level AA/AAA pass/fail badges, and a live preview of the pairing. It's for writers and note-takers choosing readable colours for notes, highlights, callouts, and docs — and it's a natural fit for a catalog whose own design system is built around WCAG contrast ratios.

  • Ratio + verdicts: computes the WCAG 2.1 contrast ratio and shows pass/fail for Normal text (AA 4.5:1 / AAA 7:1), Large text (AA 3:1 / AAA 4.5:1), and UI & graphics (3:1).
  • Live preview of the chosen pairing at heading, body, and caption sizes, plus a one-tap Swap to flip foreground/background.
  • Swatch and hex fields stay in sync both directions; the last pairing persists.

Checklist

  • It's a single file: contrast-checker/index.html with all CSS + JS inline.
  • It is fully self-contained / offline — no remote fonts, scripts, styles, images, fetch, or import. Pure math (relative luminance), no assets.
  • No analytics, trackers, or phone-home behavior.
  • Added a screenshot at screenshots/contrast-checker.webp (via npm run screenshot contrast-checker).
  • Registered the tool in tools.json (dir matches the folder name).
  • Bumped the top-level catalogVersion (24 → 25).
  • New tool — version is 1.
  • npm run validate passes locally (30 tools, no warnings).

Notes for reviewers

  • Design system: azure accent only, Manrope 900 display + Inter body, 24px card radius, surface-contrast elevation (no shadows). Every piece of UI chrome is token-driven, so the whole surface flips at prefers-color-scheme: dark.
  • The one deliberate exception to the "never hard-code a colour" rule is the preview panel and its sample text — those are set from JS to the user's chosen colours, because they are the tool's content (the thing being tested), not chrome. This is the design system's "illustrative content" allowance. Verified both light and dark render correctly.
  • Not a repeat of the closed Markdown Preview PR or the duplicate Markdown Table PRs — this is a distinct utility with no overlap with existing tools.

Generated by Claude Code

claude and others added 2 commits August 4, 2026 19:43
A single-file, fully-offline WCAG contrast checker: pick a text and
background colour (native swatch or hex), see the contrast ratio, per-level
AA/AAA pass/fail badges for normal text, large text, and UI/graphics, and a
live preview of the pairing.

- Follows the Hillnote design system: azure accent, Manrope 900 display,
  Inter body, 24px card radius, surface-contrast elevation.
- Supports light and dark mode via prefers-color-scheme; all UI chrome is
  token-driven, while the preview intentionally renders the user's chosen
  colours (the content being tested).
- Persists the last pairing in localStorage under a namespaced key.
- Registered in tools.json (version 1) with catalogVersion bumped to 25;
  screenshot added; npm run validate passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8qK6taiCzKs68frzZakYN
@02karthik
02karthik merged commit cf6b22c into main Aug 6, 2026
1 check passed
@02karthik
02karthik deleted the claude/wizardly-mayer-wwjuri branch August 6, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants