Skip to content

feat(playground): chroma lab on its own route - #9

Merged
nekomeowww merged 2 commits into
mainfrom
feat/playground-chroma-lab
Oct 27, 2026
Merged

nekomeowww merged 2 commits into
mainfrom
feat/playground-chroma-lab

Conversation

@nekomeowww

@nekomeowww nekomeowww commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a chroma lab to the playground, served on its own route so the docs page stays light.

  • Routes: / is the docs page and /lab the chroma lab. Both are lazy loaded, so the docs do not pay for fitting, heatmaps or the 3D surface.
  • Shared hue: useThemeHue() keeps the theme hue across route changes.
  • Deploy: a Netlify _redirects fallback lets /lab work on reload. This assumes playground/dist is the publish directory.
  • Lab views:
    • chroma / lightness by hue and by shade against the sRGB and P3 gamut;
    • per-model residual heatmaps and a 3D hue × shade × chroma surface;
    • side-by-side palettes;
    • ΔE against Tailwind v4 with leave-one-family-out cross-validation.
  • Lab controls: the fit from scripts/fitted/ runs live with controls, and the lab exports TS / CSS for the result.
  • Controls: Range / FieldRange are copied from moeru-ai/airi packages/ui (MIT, attributed in the files). The thumb uses currentColor instead of the v1-only --chromatic-chroma-200. ColorHueRange is synced with its AIRI counterpart.
  • Performance: the three.js views only animate while on screen. The docs page had two auto-rotating volumes rendering off screen.

Test plan

  • pnpm lint, pnpm typecheck, pnpm build, pnpm test:run
  • In Chrome:
    • / and /lab load, including a direct load of /lab;
    • the header navigation works and the hue survives route changes;
    • only the visible 3D view animates (60 loops/s instead of 120);
    • lab sliders and their reset buttons work in light and dark mode.

🤖 Generated with Claude Code

@nekomeowww
nekomeowww force-pushed the feat/playground-chroma-lab branch 2 times, most recently from ea08eb8 to a9ca92c Compare October 27, 2026 21:18
Base automatically changed from feat/fitted-model to main October 27, 2026 21:39
nekomeowww and others added 2 commits October 28, 2026 05:39
Visualizes how chroma and lightness are distributed over hue and shade:
chroma / lightness by hue and by shade against the sRGB and P3 gamut,
residual heatmaps, a 3D surface, side-by-side palettes, and ΔE against
the Tailwind CSS v4 palette with leave-one-family-out cross-validation.
It runs the fit of `scripts/fitted/` live with controls and exports TS /
CSS.

Copies the range / field-range components of moeru-ai/airi packages/ui
for the controls, syncs ColorHueRange with its AIRI counterpart, and
only animates the three.js views while they are on screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`/` is the docs page and `/lab` the chroma lab, both lazy loaded so the
docs do not pay for fitting, heatmaps and the 3D surface. The theme hue
is shared through `useThemeHue()` and survives route changes. Adds a
Netlify `_redirects` fallback so `/lab` works on reload, and documents
the lab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nekomeowww
nekomeowww force-pushed the feat/playground-chroma-lab branch from a9ca92c to af1acd2 Compare October 27, 2026 21:40
@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for proj-airi-chromatic ready!

Name Link
🔨 Latest commit af1acd2
🔍 Latest deploy log https://app.netlify.com/projects/proj-airi-chromatic/deploys/6ae11a3446a7a82ccf54bbbe
😎 Deploy Preview https://deploy-preview-9--proj-airi-chromatic.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@nekomeowww
nekomeowww merged commit c8fdee5 into main Oct 27, 2026
7 checks passed
@nekomeowww
nekomeowww deleted the feat/playground-chroma-lab branch October 27, 2026 21:41
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.

1 participant