tidyfactor-design: Command for Claude Code

.agents/skills/tidyfactor-design/references/commands/palette.md

palette is a command for Claude Code from alwkala/tidyfactor-design. It costs 0 tokens per session (450 once invoked), scanned A, original, MIT.

A command that extracts prominent colours, background tones, and accent colours from images, logos, or website screenshots. It also calculates text contrast against light and dark backgrounds using WCAG 2.1 AA rules.

In plain words
What is it for?
Use it when creating a design system from a visual reference, checking contrast ratios, or updating brand colour files.
Why use it?
It removes manual colour sampling and makes accessibility contrast checks repeatable. It can also save the results as brand data and CSS design tokens.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: installed under .agents/ (shared by several agents).

This is alwkala/tidyfactor-design's own configuration. It tells Claude Code how to work on tidyfactor-design itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tidyfactor-design configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/extract_palette.py assets/logo.png --json brand.json.

Reuse

Borrowing it

Nothing to install: this file belongs to alwkala/tidyfactor-design. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/alwkala/tidyfactor-design/main/.agents/skills/tidyfactor-design/references/commands/palette.md
Clone the repo
git clone --depth 1 https://github.com/alwkala/tidyfactor-design

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for palette

README.md
[![agentmods](https://agentmods.dev/badge/commands/alwkala/tidyfactor-design/palette.svg)](https://agentmods.dev/commands/alwkala/tidyfactor-design/palette)
Your own site
<a href="https://agentmods.dev/commands/alwkala/tidyfactor-design/palette"><img src="https://agentmods.dev/badge/commands/alwkala/tidyfactor-design/palette.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00450
Opus 5 $0.00000 $0.00225
Sonnet 5 $0.00000 $0.00090
Haiku 4.5 $0.00000 $0.00045

Measured 6d ago against content hash 2cd8374bf8d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

palette scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/tidyfactor-design/references/commands/palette.md · 36 lines

What it actually says

Command: palette — Brand Color Extraction & WCAG Contrast Check

Purpose

Extract dominant brand colors, background tones, accent highlights, and WCAG 2.1 AA contrast compliance scores from reference images, logos, or hero screenshots using the built-in Python tool scripts/extract_palette.py. Automatically updates brand.json and appends CSS custom properties to design-system/tokens.css.

When to run it

  • User phrased: "extract color palette", "extract colors from logo", "check contrast ratio", "palette", /palette.
  • During init or clone when converting a reference logo or screenshot into a design token system.

What it does

  1. Color Quantization & Extraction:
    • Runs python scripts/extract_palette.py <image_path> --json brand.json --css design-system/tokens.css.
    • Quantizes the image palette to identify dominant Primary, Secondary, and Accent brand colors.
  2. WCAG 2.1 AA Contrast Analysis:
    • Computes relative luminance and contrast ratios between text/primary colors against dark (#0F172A) and light (#F8FAFC) background surfaces.
    • Ensures text meets minimum 4.5:1 ratio (WCAG AA compliant).
  3. Token Synchronization:
    • Updates brand.json colors object.
    • Appends CSS variables (--color-primary, --color-secondary, --color-accent) to design-system/tokens.css.

Usage Examples

# Extract palette from logo and update brand.json
python scripts/extract_palette.py assets/logo.png --json brand.json

# Append extracted tokens to tokens.css
python scripts/extract_palette.py reference.png --css design-system/tokens.css

Checklist

  • Image path is valid and readable by Pillow
  • Primary, secondary, and accent colors extracted cleanly
  • WCAG contrast ratio verified (≥ 4.5:1 for body text)
  • brand.json updated with new color tokens
  • design-system/tokens.css updated with matching CSS variables
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 36 lines · 0 tokens per session scan A 2cd8374bf8d8

Subscribe to this mod's changes

palette is a command published in the GitHub repository alwkala/tidyfactor-design (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 450 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.