Skip to content
Back to search

color-expert

SkillWorks with Claude CodeGitHub

Use when working with color naming, color theory, color spaces, color definitions, or any task involving color knowledge - palettes, ramps, gradients, conversions, accessibility, perceptual matching, pigment mixing, print-vs-screen color, CSS color syntax, or historical color terminology. Use this skill whenever the user is choosing, comparing, generating, naming, converting, or explaining colors, even if they do not explicitly ask for "color theory."

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/meodai-skill-color-expert/badge.svg)](/listings/meodai-skill-color-expert)

HTML

<a href="/listings/meodai-skill-color-expert"><img src="/api/listings/meodai-skill-color-expert/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Any supported agent (recommended)

npx skills add meodai/skill.color-expert

Automatically detects your installed agents and places the skill in the correct directory. Works with Claude Code, Codex, Cursor, Copilot, OpenCode, and others.

Manual

Clone and symlink into your agent's skills directory:

git clone https://github.com/meodai/skill.color-expert ~/Sites/color-expert

| Agent | Symlink target | | ------------------- | ------------------------------- | | Claude Code | `~/.claude/skills/color-expert` | | Codex | `~/.codex/skills/color-expert` | | OpenCode | `~/.agents/skills/color-expert` | | Project-level (any) | `.agents/skills/color-expert` |

ln -s ~/Sites/color-expert ~/.claude/skills/color-expert

Updating

npx skills update

Or manually: `cd ~/Sites/color-expert && git pull`

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 321 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: color-expert
  3. description: Use when working with color naming, color theory, color spaces, color definitions, or any task involving color knowledge - palettes, ramps, gradients, conversions, accessibility, perceptual matching, pigment mixing, print-vs-screen color, CSS color syntax, or historical color terminology. Use this skill whenever the user is choosing, comparing, generating, naming, converting, or explaining colors, even if they do not explicitly ask for "color theory."
  4. ---
  5. # Color Expert
  6. A comprehensive knowledge base for color-related work. See `references/INDEX.md` for a one-line-per-file map of 180+ reference files; this skill file contains the essential knowledge to answer most questions directly.
  7. ## How to Use This Skill
  8. Match the response to the user's explicit request and clearly implied constraints from context. Five common modes:
  9. **Concrete design or art project** — "help me pick colors for my logo / poster / illustration / app." Ask about medium (print, screen, paint, mixed), brand or mood, audience, accessibility needs, and any existing colors to harmonize with. Then propose. Don't lecture about CIE 1931 or OKLCH internals unless asked. Recommend specific tools and palettes that fit the constraints, not generic theory.
  10. **Design system, ramps, or theme tokens** — "build me a 9-step accent scale", "palette for light + dark mode", "Tailwind/Radix-style ramps", "what's the right gray ramp for our brand?" Prioritize in this order:
  11. - Use OKLCH to build perceptually uniform scales (consistent lightness across hues, no muddy mid-tones).
  12. - Build a token graph: reference tokens (palette) → semantic tokens (surface, on-surface, accent, success, warning, danger) → component usage; see *Implementation Guidance* below.
  13. - Verify every text/background pair against APCA or WCAG in both light and dark.
  14. - Suggest tools only as needed: Huetone (LCH/OKLCH builder), Leonardo (contrast-ratio-driven ramps + adaptive theming, Adobe), Components.ai Color Scale (parametric), dittoTones (extract perceptual DNA from Tailwind/Radix), Color Buddy (lint). For dataviz sequential/diverging ramps specifically, CuspHanger (Wijffelaars model in OKLCH, in-gamut by construction) or viscm (the viridis editor: live perceptual-derivative diagnostics + CVD + grayscale while you drag control points).
  15. The test for a sequential ramp is **flat perceptual derivative** — plot the perceptual step size between consecutive samples; it should be a horizontal line, in color *and* in grayscale. Bumps are regions where the ramp exaggerates change that isn't in the data (this is jet's core failure, not its ugliness).
  16. **Generative art / creative coding** — "color for my fxhash piece", "palette for thousands of generated strokes", "paint-like mixing in p5.js / WebGL." Different from building a palette generator: the code *is* the artwork, and the user wants to understand the *techniques*, not copy a named artist's style. Help them compose their own system. Useful techniques to teach and combine:
  17. - **Tight constraint, then variation** — pick 3–7 hues in a narrow lightness or chroma band; variety comes from density and interaction, not palette size.
  18. - **Weighted / probability-based hue selection** — assign each color a weight so some appear often, others rarely; this is what makes a generative output feel curated instead of random.
  19. - **Narrow-band hue jitter** — small random hue offset within a fixed envelope keeps strokes feeling related but not identical.
  20. - **Lightness variation at fixed chroma** — depth and atmosphere without losing palette identity (use OKLCH).
  21. - **Spectral / K-M mixing** (Spectral.js, Mixbox) for paint-like overlap and secondaries; RGB averaging gives muddy, dull results in the same situation.
  22. - **IQ cosine palette** — `a + b·cos(2π(c·t + d))` for cyclic / periodic schemes from 12 floats.
  23. - **Anchor-based interpolation** (Poline) — set 2–3 anchors in OKLCH, get an interpolated ramp.
  24. - **Hue / lightness / chroma trajectories with easing** (RampenSau) — walk each axis along an easing function, color-space-agnostic; great when you want a deterministic ramp shape rather than random anchors.
  25. - **Harmony-aware generation with muddy-zone avoidance** (pro-color-harmonies) — adaptive OKLCH harmony with 4 styles × 4 modifiers; skips perceptually muddy regions automatically.
  26. - **Generation in historical / non-digital color spaces** (RYBitten) — work in RYB or one of 26 historical color cubes when you want a painterly feel that strict sRGB/OKLCH can't reach.
  27. - **Palette cycling / indexed color** — store an index buffer and a small palette, then animate the palette (rotate, ease, or drive from an OKLCH trajectory) instead of the pixels; motion for one lookup per pixel. Works only if each cycle range is a perceptually even closed ramp. See `references/techniques/color-cycling-indexed-palette-animation.md`.
  28. - **Scene-light sampling** (ray-color) — raytrace a sphere in a room with up to 3 colored lights and sample colors off its surface; coherence comes from shared illumination physics (like an object photographed under one light) rather than color-space geometry.
  29. - **Sun-lit ramps** (Lightfield, tol.is) — same idea aimed at design tokens: OKLCH pigments on a flat-shaded city under a Planckian-locus sun; each 50–950 ramp is a sweep of surface orientations, re-spaced in L. Adds relative chroma, cusp pull, and a hue-profiled Bezold–Brücke/Abney warm shift (toward red going dark, toward yellow going light; cool hues untouched).
  30. See `references/techniques/` for tyler-hobbs, fontana, mattdesl, iq-cosine, spectraljs, poline, rampensau, pro-color-harmonies, rybitten, ray-color, lightfield (these document the techniques, not styles to imitate).
  31. **General color question** — "what is OKLCH?", "why does my gradient go gray in the middle?", "is APCA better than WCAG?" Answer directly from this skill file or `references/INDEX.md`, and cite the relevant reference. Skip tooling unless they're asking how to do something. **Approachable and accurate usually conflict** — the tidy model (RYB primaries, 12-hue wheel, "red is opposite green") is easy precisely because it summarizes beliefs rather than measurements. Give the tidy version *and* say where it breaks; don't let "easy" quietly become "wrong." (Color Nerd, `references/contemporary/color-theory-dogma-problem.md`)
  32. **Building a generator, tool, or palette algorithm** — "I want to make a palette generator", "how do I generate accessible color scales?", "give me an OKLCH ramp function." Default to recommending an existing library before hand-rolling (Culori, Poline, RampenSau, Spectral.js — see Recommended Tools). Show working code in the user's stack, picking the color space per the table above.
  33. When the user asks to generate or compare palettes, **showcase multiple approaches with their trade-offs before narrowing to one** — anchor-based (Poline), hue-cycling (RampenSau), cosine (IQ formula), harmony-based (pro-color-harmonies), scene-lit (ray-color), and extraction-from-system (dittoTones) suit different problems. Don't be shy about presenting options.
  34. Never recommend coolors.co — it doesn't generate palettes, it picks from a hardcoded list of 7,821 pre-made ones (see Recommended Tools).
  35. ## Color Spaces — What to Use When
  36. | Task | Use | Why |
  37. | ------------------------------- | -------------------------------------- | ------------------------------------------------------------------------- |
  38. | Perceptual color manipulation | **OKLCH** | Best uniformity for lightness, chroma, hue. Fixes CIELAB's blue problem. |
  39. | CSS gradients & palettes | **OKLCH** or `color-mix(in oklab)` | No mid-gradient darkening like RGB/HSL |
  40. | Gamut-aware color picking | **OKHSL / OKHSV** | Ottosson's picker spaces — cylindrical like HSL but perceptually grounded |
  41. | Normalized saturation (0-100%) | **HSLuv** | CIELUV chroma normalized per hue/lightness. HPLuv for pastels. |
  42. | Print workflows | **CIELAB D50** | ICC standard illuminant |
  43. | Screen workflows | **CIELAB D65** or OKLAB | D65 = screen standard |
  44. | Cross-media appearance matching | **CAM16 / CIECAM02** | Accounts for surround, adaptation, luminance, and viewing conditions |
  45. | HDR | **Jzazbz / ICtCp** | Designed for extended dynamic range |
  46. | Pigment/paint mixing simulation | **Kubelka-Munk** (Spectral.js, Mixbox) | Spectral reflectance mixing, not RGB averaging |
  47. | Color difference (precision) | **CIEDE2000** | Gold standard perceptual distance |
  48. | Color difference (fast) | **Euclidean in OKLAB** | Good enough for most applications |
  49. | Video/image compression | **YCbCr** | Luma+chroma separation enables chroma subsampling |
  50. | Dithering / optical pixel mixing | **Linearized sRGB** | Adjacent subpixels add *light*, so model the **device**, not the eye. Yellow-over-blue lights the same emitters as white at half area = 50% gray; CIELAB predicts pale pink. Same rule for alpha compositing and downsampling |
  51. | Colormap uniformity | **CAM02-UCS** (or OKLAB) | CIELAB is decent for *distant* colors but poor for *nearby* ones — which is exactly what uniform sampling depends on. MATLAB's parula was made uniform in Lab and has a visible band near the bottom as a result |
  52. ### Understanding HSL's Limitations
  53. HSL isn't "bad" — it's a simple, fast geometric rearrangement of RGB into a cylinder. It's fine for quick color picking and basic UI work. But its three channels don't correspond to human perception:
  54. - **Lightness (L):** fully saturated yellow (`hsl(60,100%,50%)`) and fully saturated blue (`hsl(240,100%,50%)`) have the same L=50% but vastly different perceived brightness. L is a mathematical average, not a perceptual measurement.
  55. - **Hue (H):** non-uniform spacing. A 20° shift near red produces a dramatic change; the same 20° near green is barely visible. The green region is compressed, reds are stretched.
  56. - **Saturation (S):** doesn't correlate with perceived saturation. A color can have S=100% and still look muted (e.g., dark saturated blue).
  57. **When HSL is fine:** simple color pickers, quick CSS tweaks, situations where perceptual accuracy doesn't matter. When it isn't, the table above gives the perceptual alternative per task (OKLCH for scales, OKLAB for gradients, OKHSL for picking, HSLuv for normalized saturation).
  58. ### Named Hue (HSL/HSV) Ranges
  59. Use these degree ranges when generating or constraining colors by hue name. Source: [random-display-p3-color](https://github.com/mrmrs/random-display-p3-color) by mrmrs / mrmrs.cc.
  60. | Name | Degrees |
  61. | ---------- | ------------- |
  62. | **red** | 345–360, 0–15 |
  63. | **orange** | 15–45 |
  64. | **yellow** | 45–70 |
  65. | **green** | 70–165 |
  66. | **cyan** | 165–195 |
  67. | **blue** | 195–260 |
  68. | **purple** | 260–310 |
  69. | **pink** | 310–345 |
  70. | **warm** | 0–70 |
  71. | **cool** | 165–310 |
  72. ### Key Distinctions
  73. - **Chroma** = colorfulness relative to a same-lightness neutral reference
  74. - **Saturation** = perceived colorfulness relative to the color's own brightness
  75. - **Lightness** = perceived reflectance relative to a similarly lit white
  76. - **Brightness** = perceived intensity of light coming from a stimulus
  77. - Same chroma ≠ same saturation. These are different dimensions.
  78. ### Gamut Mapping in Practice
  79. The most common OKLCH mistake: picking a chroma that doesn't exist in the target gamut. `oklch(70% 0.3 150)` asks for more chroma than sRGB (or even P3) can show, so it silently clips — usually to something duller and hue-shifted.
  80. - **CSS gamut-maps for you.** Browsers map `oklch()` / `color()` automatically, so authored CSS rarely clips badly. JS conversions do **not** — `oklch→hex` just truncates channels.
  81. - **Reduce chroma, not lightness or hue.** Clipping R/G/B shifts the hue; pulling chroma toward the gamut boundary preserves the color's identity. Use Culori's `clampChroma(color, 'oklch')` (holds L and H) or `toGamut()` rather than naive RGB clamping.
  82. - **Test against the actual target:** `inGamut('rgb')` vs `inGamut('p3')` — a color valid in P3 can still clip in sRGB.
  83. - **Or avoid the problem by construction:** nutelch expresses chroma *relative to the gamut boundary* (`relC: 0.5` = halfway to the shell at that L/H), so generated colors can't accidentally ask for chroma that isn't there.
  84. - **Brightening is a gamut problem too.** Per-channel exposure/tone curves (clip, Reinhard, the Narkowicz "ACES fit", which is not real ACES) push bright saturated colors toward R/Y/G/C/B/M, the "notorious six". For hue-stable highlights use AgX / ACES 2 / OpenDRT (they desaturate toward white). Use Khronos PBR Neutral when authored base colors must stay exact. See Color Collapse (Dustin Brown) in `references/techniques/color-collapse-tone-mapping.md`.
  85. ## Implementation Guidance — Code and CSS
  86. When using colors in a program or CSS, add a semantic layer between raw color values and UI roles.
  87. The examples below are pseudocode, not literal CSS requirements. They express the decision structure an agent should preserve even if the target stack uses different syntax.
  88. Across CSS, JS/TS, Swift, design-token JSON, templates, or pseudocode, default to the same structure:
  89. - **Reference tokens/palette values** for concrete colors
  90. - **Semantic tokens/roles** that map meaning onto those colors
  91. - **Component usage** that consumes semantic tokens rather than raw literals
  92. Raw color literals should usually appear only in palette/reference definitions, conversions, diagnostics, or deliberately one-off examples.
  93. - **Use reference tokens for concrete colors**: `ref.red = #f00`
  94. - **Use semantic tokens for meaning/role**: `semantic.warning = ref.red`
  95. - **Prefer semantic tokens in components** so themes can swap meaning without rewriting component code.
  96. - **This default applies in any language**; translate to the target system's equivalent alias/reference mechanism (CSS custom properties, Swift enums, design-token JSON, etc.).
  97. - **Encode color decisions when possible** instead of freezing one manual choice into a literal.
  98. Pseudocode examples:
  99. - `ref.red := closest('red', generatedPalette)`
  100. - `semantic.warning := ref.red`
  101. - `semantic.onSurface := mostReadableOn(surface)`
  102. Good pattern: palette/reference tokens define available colors; semantic tokens map those colors to roles like surface, text, accent, success, warning, and danger.
  103. If a system can derive a decision from constraints, encode that derivation. Examples: nearest named hue in a generated palette, foreground chosen by APCA/WCAG target, hover state computed from the base token in OKLCH instead of hand-picking a second unrelated hex.
  104. **Especially when applying generated colors to a UI**: the generator gives you primitives, but the *mapping* onto roles is where designs rot. Don't freeze one manual mapping into literals — emit the rule. A useful decision vocabulary (from Design Book, see below):
  105. - `text := bestContrastWith(surface, palette)` — recomputes when the palette regenerates
  106. - `accent := mostVivid(palette, { against: surface, minContrast: 4.5, not: [error, success] })` — vividness gated by readability, role-reserved tokens excluded
  107. - `surface := nth(ramp, 0)`, `text := nth(ramp, -1)` — ramp roles pinned to *position*, so they survive regenerating the ramp with a different stop count
  108. - `hover := colorMix(accent, ink, 0.12)` or adaptive `shade(surface)` — flips darken/lighten by the input's lightness, so it never collapses on dark themes
  109. In CSS, many decisions can stay native (the browser re-runs them): `var()` for references, `color-mix()` for hover states, relative color syntax for channel edits — see the cheat sheet below.
  110. For larger systems, prefer a **token graph** over a flat token dump: references, semantic roles, derived functions, and scope inheritance. This makes theme changes, accessibility guarantees, and multi-platform export auditable and easier to maintain. **Design Book** (`npm install design-book`) is the reference implementation: a reactive constraint system where tokens store *how values are chosen*, dependents recompute on change, and `inspect()` explains why a value won; renders to CSS vars, JSON, and W3 design tokens. See `references/techniques/designbook-reactive-design-token-spec.md`.
  111. ## CSS Color 4/5 — Syntax Cheat Sheet
  112. Modern CSS does perceptual color natively; reach for these before pulling in a JS library.
  113. - **Perceptual color:** `oklch(70% 0.12 250)`, `oklab(0.7 -0.1 0.1)`, wide gamut via `color(display-p3 1 0.2 0.3)`.
  114. - **Mixing:** `color-mix(in oklab, blue 30%, white)` — interpolating in `oklab`/`oklch` avoids the gray mid-gradient that RGB/HSL produce. For cylinders, set a hue strategy: `color-mix(in oklch longer hue, …)`.
  115. - **Relative color syntax (derive from a base):** `oklch(from var(--brand) l c h / 0.5)`, or compute a shade/hover without a second hard-coded hex: `oklch(from var(--brand) calc(l * 0.9) c h)`.
  116. - **Light/dark without a media query:** `light-dark(white, black)` (requires `color-scheme: light dark`).
  117. - **Gamut targeting:** `@media (color-gamut: p3) { … }`.
  118. - **Gradients in a chosen space:** `linear-gradient(in oklch, red, blue)`.
  119. Broadly supported in evergreen browsers (2024+); relative color syntax is the newest piece. See `references/techniques/` CSS Color 4/5 for edge cases.
  120. ## Accessibility — Key Numbers
  121. Of ~281 trillion hex color pairs (research by @mrmrs\_, computed via a Rust brute-force run):
  122. | Threshold | % passing | Odds |
  123. | ------------------------- | --------- | --------------- |
  124. | WCAG 3:1 (large text) | 26.49% | ~1 in 4 |
  125. | WCAG 4.5:1 (AA body text) | 11.98% | ~1 in 8 |
  126. | WCAG 7:1 (AAA) | 3.64% | ~1 in 27 |
  127. | APCA 60 | 7.33% | ~1 in 14 |
  128. | APCA 75 (fluent reading) | 1.57% | ~1 in 64 |
  129. | APCA 90 (preferred body) | **0.08%** | **~1 in 1,250** |
  130. APCA is far more restrictive than WCAG at comparable readability. At APCA 90, only 239 billion of 281 trillion pairs work. JPEG compression exploits the same biology: chroma subsampling (4× less color data) is invisible because human vision resolves brightness at higher resolution than color.
  131. **Charts — the border trick.** WCAG wants 3:1 between adjacent non-text elements. Finding three chart colors that hold 3:1 against *each other* is extremely hard; beyond three it's essentially impossible. Don't try. Put a **border** on the chart elements and require 3:1 between each fill and the border color — one constraint per color instead of N². (Ström, see `references/techniques/strom-least-wrong-colors-simulated-annealing.md`.)
  132. ## Color Harmony — What Actually Works
  133. ### Hue-first harmony is a weak standalone heuristic
  134. Complementary, triadic, tetradic intervals are weak predictors of mood, legibility, or accessibility on their own. Every hue plane has a different shape in perceptual space, so geometric hue intervals do not guarantee perceptual balance. Complements are also **pigment-specific**, not name-specific: measured in OKLAB, cadmium red, quinacridone red and alizarin crimson all sit opposite cobalt teal, and chrome oxide green sits opposite a purple, not red. Compute the opposite from the actual color (OKLCH hue + 180°), never from its category name.
  135. ### Character-first harmony works (Ellen Divers' research)
  136. Organize by character (pale/muted/deep/vivid/dark), not hue. Finding: **hue is usually a weaker predictor of emotional response than chroma and lightness** — a muted palette often reads as calm across many hues. Relaxed vs intense is driven more by chroma + lightness than hue alone.
  137. ### Colour meaning in a story is per-story, not a symbolism table (Lewis Bond)
  138. For narrative work (film, games, illustration, brand storytelling) ask two questions instead of "what does red mean": what subject is the colour **associated** with by repetition, and does it **transition** as that subject changes (*The Godfather* makes orange mean death; *Blue Is the Warmest Colour* tracks the affair by blue's saturation). A single saturated outlier on a balanced scheme is a focal device; a new hue entering a settled scheme reads as disruption. See `references/contemporary/colour-in-storytelling-lewis-bond.md`.
  139. ### Legibility = lightness variation
  140. Grayscale is a quick sanity check for lightness separation, not an accessibility proof. You still need to verify contrast with WCAG/APCA and consider text size, weight, polarity, and CVD. Same character + varied lightness is often more readable. Same lightness regardless of hue is usually illegible.
  141. ### The 60-30-10 rule
  142. 60% dominant color, 30% secondary, 10% accent. One color dominates to prevent "three equally-sized gorillas fighting."
  143. ## Pigment Mixing — Not What You Think
  144. - **Pigment mixing is not well described by the simple subtractive model alone** — "integrated mixing" (Küppers/Briggs) is a better practical description. It behaves like a compromise between subtractive and additive averaging.
  145. - **CMY mixing paths curve outward** (retain chroma = vivid secondaries) — "extroverted octopus"
  146. - **RGB mixing paths curve inward** (lose chroma = dull browns) — "introverted octopus"
  147. - **Mixing is non-linear**: proportion of paint ≠ proportional hue change. You "turn a corner" at certain ratios.
  148. - **Blue→yellow is a LONG road**, red→yellow is SHORT. Traditional wheel massively misrepresents distances.
  149. - **Tinting strength varies**: blues are concentrated/strong, yellows are weak.
  150. - **White doesn't just lighten** — it shifts hue AND kills chroma.
  151. - **For spectral/K-M mixing in code**: use Spectral.js (open source) or Mixbox (commercial).
  152. ## Color Temperature
  153. - **Temperature ≠ hue** — it's a systematic shift of BOTH hue AND saturation, dependent on starting hue
  154. - **Spectral bias**: which end of the spectrum a light favors (short λ = cool, long λ = warm)
  155. - **Cool daylight**: blue atmospheric scatter fills shadows; paint neutral highlights, blue shadows
  156. - **Warm incandescent**: favors long wavelengths including infrared (literally felt as heat)
  157. - **Green and purple** do not map cleanly to warm/cool in the same way as red-orange or blue-cyan; perceived temperature depends strongly on context
  158. ## Color Naming — Multiple Systems for Different Registers
  159. | System | Register | Example |
  160. | --------------------- | -------------------------- | ---------------------------------- |
  161. | ISCC-NBS | Scientific precision | "vivid yellowish green" |
  162. | Munsell | Systematic notation | "5GY 7/10" |
  163. | XKCD | Common perception | "ugly yellow", "hospital green" |
  164. | Traditional Japanese | Cultural/poetic | "wasurenagusa-iro" (forget-me-not) |
  165. | RAL | Industrial reproducibility | RAL 5002 |
  166. | Ridgway (1912) | Ornithological | 1,115 named colors, public domain |
  167. | CSS Named Colors | Web standard | 148 names, 138 unique colors |
  168. | color-description lib | Emotional adjectives | "pale, delicate, glistening" |
  169. | colornames-oklab | Perceptually even coverage | "Smaragdine" (rec2020 tier) |
  170. | COLIBRI (fuzzy) | Graded / "between" naming | 0.6 cyan · 0.4 light blue, medium sat |
  171. Use `color-name-lists` npm package for 18 naming systems in one import. For *naming arbitrary or generated colors* — especially wide-gamut — use `colornames-oklab`: 4444 names blue-noise sampled over the Rec2020 gamut in OKLab, so no query lands far from a name (crowd-sourced lists cluster in reds/skin tones/pastels and leave gamut regions empty). Tiered srgb/p3/rec2020, zero-dep `closest()` with a unique-assignment mode for palettes.
  172. **Naming colours *from an image* — don't eyeball, sample.** Vision-language models (this agent included) name prototypical high-chroma hues reliably and degrade on non-prototypical shades, near-neutrals and fine lightness steps; CLIP-style encoders read the *word* "red" over blue ink and rarely label white/grey/black; no vision encoder yet matches human discrimination thresholds. Extract pixel values with code (sample regions → OKLCH → `colornames-oklab` / ISCC-NBS) and treat a visual impression as a hypothesis. Measured: six VLMs score 83–100% on focal Munsell chips but 64–83% on the full 330, and all converge on the same 21 names (Gomez-Villa 2025). For genuine boundary colours, humans themselves split their votes (COLIBRI, n = 2,496) — report proportions, not a winner. See `references/contemporary/colour-in-computer-vision-vlm.md` and `color-names-in-vlms-gomez-villa.md`.
  173. ## Historical Corrections
  174. - **Moses Harris (1769)** was first to place RYB at equal 120° — Newton, Boutet, Schiffermüller didn't. His own wheel needed a 4th pigment. The origin of bad color theory.
  175. - **Von Bezold (1874)** killed "indigo" as a spectral color — Newton's "blue" ≈ modern cyan, Newton's "indigo" ≈ modern blue.
  176. - **The word "magenta"** wasn't used for the subtractive primary until 1907 (Carl Gustav Zander). Before: "pink" (Benson 1868), "crimson," "purpur."
  177. - **Amy Sawyer (1911)** patented a CMY wheel (primrose/rose/turquoise) decades before it became mainstream.
  178. - **Elizabeth Lewis (1931)** married trichromatic + opponent process on one wheel, anticipating CIE Lab/Luv by decades.
  179. ## Recommended Tools
  180. ### Palette Generation (actual algorithms, not pre-made swatches)
  181. Note: coolors.co does not generate palettes — it picks randomly from 7,821 pre-made palettes hardcoded in its JS bundle.
  182. - **RampenSau** — hue cycling + easing, color space agnostic
  183. - **CuspHanger** — the Wijffelaars 2009 EuroVis palette model in OKLCH: Bézier paths through each hue's black–cusp–white gamut triangle, perceptual lightness sampling calibrated against Brewer. Sequential/diverging ramps for dataviz, in-gamut by construction, sRGB + Display-P3, RampenSau-compatible API; `fromColor()` inverse-solves the model so the ramp passes exactly through a color you already have (brand color → dataviz ramp)
  184. - **Poline** — anchor points + per-axis position functions (1.2K stars); ships a `<poline-palette>` web component for interactive controls
  185. - **pro-color-harmonies** — adaptive OKLCH harmony, muddy-zone avoidance, 4 styles × 4 modifiers
  186. - **dittoTones** — extract Tailwind/Radix "perceptual DNA", apply to your hue
  187. - **FarbVelo** — random palettes with dark→light structure
  188. - **ray-color** — palettes from a raytraced scene ("edit the conditions, not the colors"): sphere + five-sided room + up to 3 colored lights, mirror walls as virtual light sources; sample geodesic lines/circles off the surface. Deterministic, linear-RGB shading, zero deps, ~6 kB, DOM-free for headless use; interactive playground with draggable lights and PNG/code export
  189. - **Lightfield** (tol.is) — drag a sun around a 3D city; every face is a swatch. Token ramps from surface-orientation sweeps under one light, with relative chroma, cusp pull, hue-profiled warm shift, tinted named neutrals (Slate, Sand, Mauve…); exports OKLCH-only CSS/JSON/Tailwind. See `references/techniques/lightfield-sunlit-city-palettes.md`.
  190. - **IQ Cosine Formula** — `color(t) = a + b*cos(2π(c*t+d))`, 12 floats = infinite palette
  191. - **aek palettes** (Kensler) — the other optimizer approach, tuned for *general-purpose drawing* rather than dataviz categories: anneal on two competing CIEDE2000 objectives, maximin separation (pushes to saturated cube faces) vs. RMS coverage of the RGB cube (pulls to duller interior). Ready-made free 16/32/48/54-color palettes, perceptually even-stepped by construction. Paired with a **palette mapping** tool: edges from each color to every lighter color within a CIEDE2000 threshold (= heaviest edge of the MST), laid out by GraphViz `dot`, which reveals a palette's ramps and its desaturated spine
  192. - **category-colors** (Ström) — the *optimizer* approach rather than a constructive model: write a weighted loss function (similarity to a brand reference + ΔE separation + CVD separation per deficiency type) and let simulated annealing search. Best when your criteria conflict and no color-space geometry expresses them; the weights become the explicit, auditable design decision. `npx categorycolors run`; pluggable evaluators (energy, range, JND, similarity, WCAG contrast, avoid-these-colors, saliency), per-channel locking so a brand hue survives while lightness/saturation move, and `categorycolors report` to audit any existing palette for JND collisions under simulated CVD. Node + Culori, MIT
  193. ### Palette Analysis & Linting
  194. - **Color Buddy** — 38 lint rules (WCAG, CVD, distinctness, fairness, affect)
  195. - **Censor** — Rust CLI, CAM16UCS analysis, 20+ viz widgets
  196. - **Color Palette Shader** — WebGL2 Voronoi, 30+ color models, 11 distance metrics
  197. - **PickyPalette** — interactive sculpting on color space canvas
  198. ### Color Libraries (code)
  199. - **Culori** — 30 spaces, 10 distance metrics, gamut mapping, CVD sim
  200. - **nutelch** — gamut-relative chroma in OKLCH/LCH: `relC: 0.5` = "halfway to the gamut boundary" at any lightness/hue. The one OkHSL idea (boundary-relative saturation) without leaving native `oklch()` — LUT-backed (faster than OkHSL's runtime gamut math), zero runtime deps, sRGB + P3
  201. - **@texel/color** — 5–125× faster than Color.js, minimal, for real-time
  202. - **colordx** (`@colordx/core`) — chainable CSS-facing manipulation with OKLCH native, 7.6 kB, 0 deps, plugin-gated extras (Lab/LCH/CMYK/P3/Rec.2020/APCA/harmonies). Keeps out-of-gamut OKLCH unclamped and lets you pick the fold: `.mapSrgb()` (CSS Color 4 chroma reduction, holds L+H) vs `.clampSrgb()` (naive clip, what browsers render). Zero-allocation `*Into` channel converters for per-pixel work. Note `.mix()` is sRGB — use `.mixOklab()`
  203. - **@colordx/gpu** — the same colordx math generated as GLSL and parity-tested against the CPU library, plus a WebGL2 renderer for the gamut-slice chart behind every OKLCH/LCH picker (one draw per frame instead of a per-pixel CPU loop). Gamuts are independent layers rather than an assumed nesting, so A98 draws correctly; `maxChromaLUT` stretches the chroma axis to the gamut shell (nutelch's `relC` idea, GPU-side). Reach for it when building a picker UI or any wide-gamut visualization
  204. - **Spectral.js** — open-source K-M pigment mixing (blue+yellow=green)
  205. - **RYBitten** — RGB↔RYB with 26 historical color cubes
  206. - **colorgram** — 1 kB image palette extraction; 64-bucket HLS+luminance quantization, ~15 ms for 340×340, fixed memory
  207. - **Art Palette** — JS palette extraction from `ImageData` + Python/TensorFlow perceptual palette embeddings for search-by-color (Google Arts & Culture, Apache 2.0)
  208. - **Palette Studio** (meditationsincolor.com, Pixel Symphony) — best-in-class on paintings and posters: OKLab k-means for coverage *plus* an accent-salience pass, so small vivid touches survive instead of averaging into mud; then coverage is measured back for proportions. Pigment-vocabulary names. Browser-only, nothing uploaded.
  209. - **Pixi** (Xander Stagwood) — image → designed 7-chip card, not a measurement: each cluster shown as its *vivid face* (mean of its most chromatic 25 % of pixels, so a red on dark doesn't average to brown), chips picked by role (dark/light anchors, hero, earned accent), then lightness fitted to one ramp. Every nudge is guarded to never leave chips closer than ΔE_OK 0.08
  210. - **random-display-p3-color** — generate random Display P3 colors constrained by named hue/saturation/lightness, zero deps, ESM (by mrmrs / mrmrs.cc)
  211. ### Sorting Colors
  212. Sorting an arbitrary set of colors into a perceptually smooth sequence has **no single correct linear order** — color is 3D, so any 1D ordering is a *path* through a 3D space, closely related to the Travelling Salesman Problem. Naive sorts fail predictably: by hue alone interleaves lights and darks; by lightness alone collapses distinct hues; `.sort()` on a packed RGB/HSL value produces jagged, meaningless jumps. Don't hand-roll a single-channel sort.
  213. - **colorsort-js** (darosh) — the reliable default for ordering colors. Treats it as a smoothest-path problem (nearest-neighbor / TSP-style) with quantitative smoothness metrics, working in perceptual space; powers okpalette.color.pizza and FarbVelo. Reach for this in almost any "put these colors in a sensible order" situation — palette display, swatch panels, generative output, extracted image palettes. See `references/techniques/colorsort-js.md`.
  214. ### Key Online Tools
  215. - **oklch.com** — OKLCH picker
  216. - **Huetone** — accessible color system builder (LCH/OKLCH), by Ardov
  217. - **Ardov Color Lab** — gamut mapping playground, P3 space explorer, harmony generator, 3D color space visualizations, themer (lab.ardov.me)
  218. - **Components.ai Color Scale** — parametric scale generator: 6 spaces, 4 curve methods, WCAG contrast (by mrmrs / mrmrs.cc)
  219. - **Leonardo** — Adobe's open-source contrast-based ramp builder (leonardocolor.io): swatches generated from **target contrast ratios** (or target lightness) instead of hand-picked, across multiple color spaces; adaptive light/dark theming, CVD-safe cycling, exports CSS vars + W3C design tokens. Pairs with the `@adobe/leonardo-contrast-colors` npm lib for runtime adaptive theming. By Nate Baldwin / Adobe.
  220. - **BairesDev Color Palette Editor** — quick HSV-based ramp editor: interpolate between swatches, map palettes, import/export. Fine for fast drafts, but HSV interpolation isn't perceptually uniform (see *Understanding HSL's Limitations*) — prefer Leonardo/Huetone/Components.ai for production ramps.
  221. - **View Color** — real-time analysis, WCAG + APCA, CVD preview
  222. - **APCA Calculator** — apcacontrast.com
  223. ## Deep References
  224. Start at `references/INDEX.md` — a compact map, one line per file, cheap to read whole. When that
  225. line is too terse to choose between two files, the per-directory indexes
  226. (`references/historical/INDEX.md`, `contemporary/INDEX.md`, `techniques/INDEX.md`) carry the full
  227. summaries and source links, and `references/techniques/ONLINE-TOOLS.md` lists the online tools.
  228. The three directories hold:
  229. - **`historical/`** — Ostwald, Helmholtz, Bezold, Ridgway 1912, ISCC-NBS, Munsell, Albers, Caravaggio's pigments, Moses Harris, Lewis/Ladd-Franklin
  230. - **`contemporary/`** — Ottosson's OKLAB articles, Briggs lectures, Fairchild, Hunt, CIECAM02, MacAdam ellipses, Koenderink 2026 empirical 3D metric field (RGB supports ~1,000 qualitative regions; cool side coarser than warm; chromatic circle is not well-tempered), Pointer's gamut, CIE 1931/standard observer, Pixar Color Science, Acerola, Juxtopposed, Computerphile, bird tetrachromacy, OLO, GenColor paper, colour in computer vision / VLM colour deficiencies (ColorBench, CLIP Stroop test, encoder thresholds). Full scrapes: huevaluechroma.com and colorandcontrast.com
  231. - **`techniques/`** — All tools above documented in detail, plus: CSS Color 4/5, ICC workflows, Tyler Hobbs generative color, Harvey Rayner Fontana approach, Goethe edge colors as design hack, mattdesl workshop + K-M simplex, CSS-native generation, IQ cosine presets, Erika Mulvenna interview, Bruce Lindbloom math reference, image extraction tools, Aladdin color analysis
README.md · README · 218 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # color-expert
  2. An [agent skill](https://agentskills.io) that turns your coding agent into a color science expert. Built from resources I keep looking up, returning to, and sharing with others.
  3. ## What this is
  4. This started as a simple skill file with some color theory notes. Over time it grew into a comprehensive knowledge base as I kept pasting videos, articles, tools, and papers that I find myself referencing again and again — both for my own work building color tools and for explaining color concepts to others.
  5. The skill has three layers:
  6. 1. **`SKILL.md`** — The "greatest hits" that your agent loads immediately. Key facts, corrections, tool recommendations, and guidelines that answer most color questions without needing to dig deeper.
  7. 2. **`references/INDEX.md`** — A compact map, one line per reference file, meant to be read whole when the agent needs to find the right file. Full summaries and source links live in per-directory indexes (`references/*/INDEX.md`) that are only opened when the one-liner is too terse to choose.
  8. 3. **`references/`** — Deep reference material: full video transcripts, article summaries, library documentation, scraped websites, and research notes.
  9. There is also a lightweight **`evals/`** folder for realistic trigger and task prompts so the skill can be reviewed against actual usage instead of only edited by intuition. `evals/TRIGGERING.md` states the rule those trigger cases encode, so the boundary is arguable in writing rather than per-case.
  10. ## How it was built
  11. The collection process is simple: when I come across a color resource worth keeping — a YouTube video, a GitHub repo, a research paper, an article — I paste the URL and the skill's workflow captures it:
  12. - **Videos** get transcribed via [`yt-dlp`](https://github.com/yt-dlp/yt-dlp), summarized, and key concepts extracted
  13. - **PDFs and documents** get converted to markdown via [`markitdown`](https://github.com/microsoft/markitdown) by Microsoft
  14. - **GitHub repos** get their README/docs fetched and documented
  15. - **Articles** get their content extracted and saved
  16. - **Books mentioned in videos** get searched on Archive.org; freely available PDFs get downloaded
  17. - **Websites** (like huevaluechroma.com) get fully scraped chapter by chapter
  18. - **Tools and links** mentioned in any resource get collected into the Online Tools table
  19. Everything goes into one of three folders and gets indexed.
  20. ## Structure
  21. ```text
  22. SKILL.md # The skill definition (loaded on activation)
  23. CLAUDE.md # Claude Code repo instructions
  24. references/
  25. INDEX.md # Compact map: one line per reference file
  26. PDFS.md # Primary-source PDFs (gitignored, archive.org links)
  27. historical/ # Pre-digital color science
  28. INDEX.md # Full summaries + sources for this directory
  29. *.md # Ostwald, Helmholtz, Bezold, Ridgway, ISCC-NBS,
  30. # Moses Harris, Amy Sawyer, Lewis/Ladd-Franklin,
  31. # Caravaggio's pigments, Itten critique...
  32. pdfs/ # Source books from Archive.org (gitignored, see PDFS.md)
  33. contemporary/ # Modern color science & theory
  34. INDEX.md # Full summaries + sources for this directory
  35. *.md # OKLAB articles, Briggs lectures, CSA webinars,
  36. # Pixar Color Science, bird tetrachromacy, OLO,
  37. # Acerola, Juxtopposed, Computerphile, GenColor paper...
  38. huevaluechroma/ # Full scrape of David Briggs's site (11 chapters)
  39. colorandcontrast/ # colorandcontrast.com extracted content
  40. pdfs/ # Research papers (gitignored)
  41. techniques/ # Tools, libraries, methods, practical application
  42. INDEX.md # Full summaries + sources for this directory
  43. ONLINE-TOOLS.md # Pickers, generators and analysers, with what each is for
  44. *.md # Spectral.js, Culori, Color.js, RampenSau, Poline,
  45. # RYBitten, PickyPalette, Color Buddy lint rules,
  46. # APCA/Myndex, IQ cosine formula, Cubehelix,
  47. # Tyler Hobbs generative color, Fontana approach,
  48. # pixel art palettes, Book of Shaders, LYGIA,
  49. # paint mixing lecture, color harmony lecture...
  50. evals/
  51. TRIGGERING.md # The rule the trigger cases encode
  52. trigger-evals.json # Realistic should-trigger / should-not-trigger prompts
  53. task-prompts.md # Realistic color tasks for qualitative review
  54. scripts/
  55. stats.sh # Source of every count quoted in this README
  56. MAINTENANCE.md # What belongs where, source quality bar, review rubric
  57. ROADMAP.md # Planned scripts and future extensions
  58. ```
  59. ## Reviewing the skill
  60. The repo now includes a minimal review loop rather than a heavy benchmarking framework:
  61. 1. Use `evals/trigger-evals.json` to sanity-check whether the frontmatter description is likely to trigger in the right situations, and `evals/TRIGGERING.md` when a case looks arguable.
  62. 2. Use `evals/task-prompts.md` to test whether the skill answers realistic color questions at the right level.
  63. 3. Use `MAINTENANCE.md` when deciding whether something belongs in `SKILL.md`, `references/`, or not in the repo at all.
  64. 4. Use `ROADMAP.md` to track planned color-specific scripts and larger repo improvements.
  65. ## What's in it
  66. ### By the numbers
  67. Counted at the last update; run `bash scripts/stats.sh` to refresh rather than trusting these.
  68. | | Count |
  69. | ------------------------------- | -------: |
  70. | Markdown reference files | 185 |
  71. | Total words | ~370,000 |
  72. | Source PDFs (local, gitignored) | 14 |
  73. | Online tools catalogued | 74 |
  74. | Distinct video sources | 109 |
  75. ### Historical color science
  76. The resources I keep returning to when explaining where color theory came from and where it went wrong:
  77. - **Ostwald** (1918–1930) — the 24-hue perceptual circle that dominated the 1930s–40s then disappeared
  78. - **Helmholtz** (1856) — foundational physiological optics; last major physicist to use "indigo"
  79. - **Bezold** (1874) — killed indigo as a spectral color; renamed it "ultramarine blue"
  80. - **Ridgway** (1912) — 1,115 named colors for naturalists; fully digitized as JSON
  81. - **ISCC-NBS** (1955) — 319 systematically named color blocks
  82. - **Moses Harris** (1769) — the origin of bad RYB color theory (his own wheel needed a 4th pigment)
  83. - **Amy Sawyer** (1911) — patented a CMY wheel decades before it was mainstream
  84. - **Elizabeth Lewis** (1931) — married trichromatic + opponent process, anticipating CIE Lab/Luv by decades
  85. - Plus: Caravaggio's copper resinate technique, Itten's seven contrasts (critically reviewed), the evolution of "magenta" as a color name, Frank Reilly's controlled palette
  86. ### Contemporary color science
  87. The theory and science I reference when building tools or explaining why things work the way they do:
  88. - **Bjorn Ottosson's OKLAB articles** — all four foundational posts (OKLAB, color picker spaces, gamut clipping, "how software gets color wrong")
  89. - **David Briggs's huevaluechroma.com** — fully scraped, 11 chapters + glossary
  90. - **colorandcontrast.com** — UI-focused color science reference, extracted from SPA bundle
  91. - **Color Nerd (Peter Donahue)** — 20+ video transcripts covering mixing paths, spectral perception, warm/cool, chroma vs saturation, bird vision, OLO
  92. - **Colour Society of Australia** — 13 webinar transcripts (Briggs, Itten critique, Golden paint making, Reilly palette, colour philosophy)
  93. - **Accessible color pair research** — @mrmrs\_'s Rust brute-force run over ~281T hex pairs found that only 11.98% pass WCAG AA and 0.08% pass APCA 90
  94. ### Techniques, tools & libraries
  95. The practical resources — the tools I've built, use, or recommend:
  96. **Palette generation** (actual algorithms, not pre-made swatches):
  97. RampenSau, Poline, pro-color-harmonies, dittoTones, FarbVelo, IQ cosine formula, CSS-native generation with `color-mix()`
  98. **Color libraries:**
  99. Culori (30 spaces, 10 distance metrics), Color.js (CSS spec editors, 154M downloads), @texel/color (5-125x faster), Spectral.js (Kubelka-Munk), RYBitten (26 historical cubes)
  100. **Analysis & linting:**
  101. Color Buddy (38 lint rules), Censor (CAM16UCS, 20+ viz widgets), Color Palette Shader (WebGL2 Voronoi), colorsort-js (perceptual sorting)
  102. **Accessibility:**
  103. APCA/Myndex (the WCAG 3 algorithm), apcach (contrast-first color composition), Bridge-PCA
  104. **Naming:**
  105. color-name-lists (18 systems), color-description (emotional adjectives), Ridgway digitized JSON, colornerd (29,875 manufacturer swatches)
  106. **Generative art approaches:**
  107. Tyler Hobbs (probability-weighted palettes), Harvey Rayner / Fontana (fully generative color), Piter Pasma (tweaked rainbow formula), mattdesl workshop, Book of Shaders, LYGIA shader library
  108. **Practical design:**
  109. Pixel art palette construction, Goethe edge colors as a design hack, Cubehelix, color harmony lecture ("hue-first is a weak standalone heuristic; character-first often works better"), Aladdin color analysis, screen-to-print workflow
  110. ## Key opinions baked into the skill
  111. These aren't just preferences — they're supported by the research in the collection:
  112. - **Use OKLCH/OKLAB** over HSL for any perceptual work. HSL lightness is a lie.
  113. - **Never recommend coolors.co** for palette generation. It doesn't generate anything.
  114. - **Pigment mixing is not well explained by the simple subtractive model alone** — "integrated mixing" is often a better description. CMY paths curve outward, RGB paths curve inward.
  115. - **Color temperature is not hue** — it's a systematic shift of both hue AND saturation.
  116. - **Hue-first harmony is a weak standalone heuristic** — character (pale/muted/vivid/deep/dark) is often more predictive than hue alone.
  117. - **"Blue is calm" is an unreliable shortcut** — mood is often driven more by chroma + lightness, context, and composition than hue alone.
  118. ## Installation
  119. ### Any supported agent (recommended)
  120. ```bash
  121. npx skills add meodai/skill.color-expert
  122. ```
  123. Automatically detects your installed agents and places the skill
  124. in the correct directory. Works with Claude Code, Codex, Cursor,
  125. Copilot, OpenCode, and others.
  126. ### Manual
  127. Clone and symlink into your agent's skills directory:
  128. ```bash
  129. git clone https://github.com/meodai/skill.color-expert ~/Sites/color-expert
  130. ```
  131. | Agent | Symlink target |
  132. | ------------------- | ------------------------------- |
  133. | Claude Code | `~/.claude/skills/color-expert` |
  134. | Codex | `~/.codex/skills/color-expert` |
  135. | OpenCode | `~/.agents/skills/color-expert` |
  136. | Project-level (any) | `.agents/skills/color-expert` |
  137. ```bash
  138. ln -s ~/Sites/color-expert ~/.claude/skills/color-expert
  139. ```
  140. ### Updating
  141. ```bash
  142. npx skills update
  143. ```
  144. Or manually: `cd ~/Sites/color-expert && git pull`
  145. ## What triggers the skill
  146. The skill activates when your agent detects work involving:
  147. - Color naming or defining colors in natural language
  148. - Color spaces (RGB, HSL, LCH, OKLCH, Lab, etc.)
  149. - Palette generation or analysis
  150. - Accessibility and contrast (WCAG, APCA)
  151. - Color theory questions
  152. - Color conversion
  153. - Pigment/paint mixing
  154. - Historical color terminology
  155. ## License
  156. Original project materials in this repository, including README.md, SKILL.md, and references/INDEX.md, are licensed under CC BY 4.0. Third-party source materials and source-derived reference content remain subject to their original authorship and licenses. See LICENSE and THIRD_PARTY_NOTICES.md.
  157. ---
  158. _The skill itself was vibe-coded, but the underlying knowledge base came from a collection of color resources I curated over time. Original sources remain attributed to their authors._
  159. _Compiled by [@meodai](https://github.com/meodai) — one URL at a time._

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.