Skip to content

sprezzature-colors

Colors

Color tooling, make and audit: Web Content Accessibility Guidelines (WCAG) contrast with fixes in the perceptual OKLCH color space (Lightness, Chroma, Hue of the OKLab model), colour-vision-deficiency simulation, a curated palette, and a Tailwind config emitter. Deterministic: no model, no network.

Makes

  • A curated palette comma-separated values (CSV) file with semantic projections
  • A Tailwind theme.extend.colors config from the canonical palette
  • Perceptual lighten / darken on the OKLCH L axis

Audits

  • WCAG contrast audit with OKLCH-neighbour fix suggestions
  • Protanopia / deuteranopia / tritanopia simulation on screenshots

Say one of these

The skill triggers itself on phrasing like this, no command to memorize.

contrast audit is my palette accessible colorblind preview deuteranope / CVD lighten this color OKLCH brand colors palette to tailwind color-blind safe

Reference library

The knowledge the skill draws on: read them straight from the repo.

Frequently asked questions

How do I install sprezzature-colors?

Run pip install sprezzature-colors (Python 3.10 or later): one line installs the four tools, the command line, the image simulation, the HTTP API and the MCP server, with no extras to choose. To use it as an agent skill, pip install sprezzature then sprezzature-skills --install (or sprezzature-skills --install --agent opencode).

What does sprezzature-colors do?

sprezzature-colors has four tools: a WCAG contrast audit of a palette that suggests a passing colour for each failing pair, a simulation of how an image looks with protanopia, deuteranopia or tritanopia (plus a grayscale version), a remap of the palette to one of six accessibility levels, and an export of the palette as a Tailwind configuration. The front door is sprezzature-colors, and each tool is also its own command, such as sprezzature-colors-contrast or sprezzature-colors-cvd.

Does sprezzature-colors check the colours of my web page?

No: sprezzature-colors audits the colour pairs of a palette (a JSON file whose keys start with label-, brand- or surface-), and simulates colour blindness on an image such as a screenshot; it does not read HTML or CSS. Contrast on a rendered page against its real background is the job of a browser-based tool such as axe-core or Lighthouse.

How is sprezzature-colors different from an online contrast checker?

sprezzature-colors checks at once every pair of a palette that can appear together in a theme (--all-pairs for the full cross-product), at the ratio set with --target, where an online checker tests one foreground and background typed by hand. For each failure it suggests the nearest passing colour with the same hue and saturation, only lighter or darker, and it runs offline, from a script or a CI job.

Does sprezzature-colors send my files to a cloud service or use AI?

No: sprezzature-colors is deterministic colour arithmetic that calls no AI model and never touches the network, so it needs no Ollama; and the simulation writes its images on your own disk, next to the source by default.

Can I run sprezzature-colors in CI?

Yes: sprezzature-colors-contrast --palette palette.json exits 0 when every pair passes, 1 when one fails and 2 when the palette yields no pair to check, and --format json gives a report a CI job can parse. An HTTP API (POST /v1/contrast) runs the same check for a pipeline written in another language.

Can I use sprezzature-colors without Claude Code?

Yes: sprezzature-colors is a Python library (import sprezzature_colors as sc), a command line, an HTTP API with a Docker image, and an MCP server, sprezzature-colors-mcp, for any MCP client. The Docker image runs that server, so one port answers both the HTTP routes and /mcp.

Is sprezzature-colors free?

Yes: sprezzature-colors is open source under the BSD 3-Clause licence, with no account, API key or paid tier, and the source is on GitHub.