--- name: color description: Generate and audit sRGB palettes, color harmonies, contrast pairs, and interactive state colors from a selected seed. --- # Color Use this skill when a project needs a palette, hue relationships, color states, contrast calculations, or a color-token audit. ## When not to use - Use `theme-select` to choose a whole visual direction. - Use `design-tokens` to combine the palette with type, spacing, shape, density, and motion. - Use `components` for control anatomy and component-specific token use. - Do not choose a new brand color when the brief or existing identity already constrains it. ## Procedure 1. Read the project brief and theme. Choose the seed from a user-supplied brand color, a stated mood translated into a proposed seed, or a selected theme. 2. If seed or harmony choice is high-impact or ambiguous, ask using the [decision protocol](../narmaforge/references/decision-protocol.md). Record choices and assumptions. 3. Choose one harmony that fits the content. Keep one accent hue by default; add another only when the theme needs separate semantic or data series colors. Treat the 60-30-10 layout split as a flexible composition heuristic, not a contrast rule. 4. Generate both required modes when the brief asks for them. Check text with WCAG 2.x contrast ratio and meaningful control cues against adjacent colors. Never round a failed contrast result up. 5. Inspect `color-preview.html`, including the contrast matrix. Use auto-adjustment notes to explain any hue, lightness, or state changes. 6. Report the seed, harmony, wheel, modes, outputs, threshold results, and any surface that could not be checked. ## Inputs and outputs - Inputs: a hex or OKLCH seed, harmony, wheel, target modes, and the brief's color/accessibility constraints. - Outputs: `palette.json`, `palette.css`, `tailwind.theme.css`, and a self-contained `color-preview.html`. - The CLI and importable engine use only Python's standard library and local files. Output creation refuses to replace existing files unless `--force` is supplied. ## CLI ```bash python skills/color/scripts/color_engine.py generate "#31687a" --harmony analogous --output-dir .narmaforge/color python skills/color/scripts/color_engine.py contrast "#000000" "#ffffff" python skills/color/scripts/color_engine.py check .narmaforge/project/tokens.json ``` Normal CLI output shows the adjustment count. Add `--verbose` when adjustment records and reasons are needed. ## References | Need | Load | |---|---| | Conversion, contrast, generated output, and metric limits | [color method](references/color-method.md) | | Artist-style hue mapping | [RYB mapping](references/ryb-wheel.md) | | State derivation and tunable thresholds | [state rules](references/state-rules.json) | Use a chosen stack only after the stack decision. The color engine emits CSS-first theme variables for current Tailwind CSS documentation and does not run that framework.