Color Spaces is a modern web tool that helps cinematographers, colorists, DI and VFX teams compare color gamuts with real-world data. The interface layers selectable color-space triangles over an interactive chromaticity diagram—defaulting to CIE 1931 xy with an optional CIE 1976 u'v' projection—making it easy to see overlaps, out-of-gamut risks, and white-point offsets at a glance.
- Interactive chromaticity viewer implemented in-house with WebGL canvas + SVG overlays, custom zoom/pan, hover outlines, and tone-curve-aware tooltips, plus a quick toggle between CIE 1931 xy and CIE 1976 u'v'.
- GPU-accelerated LUT preview lives at
/lut, applying.cube3D LUTs to local stills with a WebGL2 pipeline (and a packed WebGL fallback) entirely client-side. - Curated catalog of 70+ color spaces generated from the
colour-sciencedataset with manual aliases and tone-curve metadata. - Fast multi-select & search sorted by industry adoption, complete with disabled entries for profiles that lack primaries (e.g. PQ, HLG). A clear button empties the active list instantly.
- Adaptive theming keeps the middle-grey aesthetic by default while offering a light-mode toggle for bright environments.
- Responsive layout introduces a tablet-first (768px) breakpoint so the sidebar, diagram, and detail cards collapse gracefully on smaller viewports while maintaining balanced gutters.
- Gamut quick-reference cards showing high-precision xy pairs plus linked tone curve information for each active space.
- ACES AP naming clarifies gamuts as AP0/AP1 with the original encodings noted in brackets (e.g.
ACES AP1 (ACEScct)). - Legend-aware exports so downloaded diagrams match the viewport clipping and include a colour-space key for offline sharing.
- Feedback workflow that captures product notes via a modal, ready to persist to Azure Table Storage.
- Performance-focused UI with Next.js 15, Tailwind 4, and subtle transitions on a cinematic middle-grey palette. The Planckian locus is opt-in to keep the default view clean.
- Session persistence remembers your active colour spaces, Planckian locus preference, and diagram zoom across reloads.
- Configurable chromaticity zoom starts two steps out from the base scale; adjust
DEFAULT_ZOOM_SCALEinsrc/components/chromaticity/chromaticityDiagram.tsxto change the initial framing.
- Next.js 15 (App Router, Turbopack)
- React 19 with Tailwind CSS 4
- Custom chromaticity renderer (WebGL + SVG) inspired by
react-cie-1931 - Auto-generated color-space data via
colour-sciencePython package - Vitest + Testing Library for unit tests
- Azure Static Web Apps workflow, optional Azure Table Storage persistence, optional Docker image
- Deployment runtime locked to Node.js 20 via
staticwebapp.config.json
- Node.js 20+
- npm 10+
npm install
npm run generate:color-spaces # refresh the catalogue (idempotent)
npm run devThe dev server runs on http://localhost:3000 with hot refresh. The chromaticity viewer needs a browser that supports WebGL.
| Command | Description |
|---|---|
npm run dev |
Start the Next.js dev server with Turbopack |
npm run build |
Production build with standalone output (used by Azure & Docker) |
npm run start |
Start the production server (after npm run build) |
npm run lint |
ESLint over the full project |
npm run test |
Run Vitest in CI mode |
npm run test:watch |
Run Vitest in watch mode |
npm run generate:color-spaces |
Rebuild src/data/generatedColorSpaces.ts from colour_rgb_colourspaces.json |
- Navigate to
/lutto load a still image (PNG, JPEG, etc.) alongside a.cube3D LUT. All processing stays on-device; files are never uploaded. - WebGL2 is preferred and stores the LUT in a 3D texture. Browsers without WebGL2 fall back to a packed 2D layout with manual slice interpolation so the preview still functions.
- A background Web Worker parses
.cubefiles (supportingLUT_3D_SIZE,DOMAIN_MIN, andDOMAIN_MAX) to keep the UI responsive. Large images are automatically resized so the longer edge is at most 2048px. - The preview currently assumes uploaded images are already linear / scene-referred. Prep grabs in your grading tool before loading them so the LUT sees the same values you expect; sRGB conversion will return in a future update.
colour_rgb_colourspaces.jsonis a JSON export produced via the Pythoncolour-sciencepackage (seescripts/generate-color-spaces.mjs).- The generator script normalises names, attaches popularity heuristics, aliases, tone curves, and manually adds descriptive records for transfer-only standards.
- Run
npm run generate:color-spaceswhenever updating the JSON source or the generator logic.
npm run lint
npm run testVitest is configured with Testing Library + JSDOM. GitHub Actions runs both linting and tests on every push/PR before deploying.
- Provision an Azure Static Web App (Standard or Free) with Node 20 runtime.
- In GitHub, set the secret
AZURE_STATIC_WEB_APPS_API_TOKENwith the deployment token from the Azure portal. - (Optional) Create an Azure Storage account + Table named
ColorSpaceRequests, then set:AZURE_TABLE_CONNECTION_STRING(connection string for the storage account)AZURE_TABLE_NAME(optional override, defaults toColorSpaceRequests) Add them as GitHub secrets or Static Web Apps application settings.
- Push to
main–.github/workflows/deploy.ymlwill run quality checks, build the Next.js app, and upload artefacts viaAzure/static-web-apps-deploy@v1. The default worker runtime is pinned to Node.js 20 throughstaticwebapp.config.json(platform.apiRuntime).
The API route app/api/request-color-space stores feedback submissions in Azure Table Storage when AZURE_TABLE_CONNECTION_STRING is provided. Without it, submissions still succeed but are only logged to the server console. Extend this route to push to Logic Apps, SendGrid, or Teams as needed.
A production-ready Dockerfile is included for Azure Container Apps, App Service, or local orchestration:
docker build -t clrviz .
docker run -p 3000:3000 clrvizThe build stage generates the color-space catalog and produces the Next.js standalone output, so the runtime image is slim and quick to start.
- Data lives in
src/data/generatedColorSpaces.tsand is consumed throughsrc/lib/colorSpaces.ts. - UI centres around
ColorSpacesExperience, which handles search, selection, palette assignment, the chromaticity diagram, and the feedback modal. - API is a single route for request submissions; any additional backend integrations can sit alongside it.
- Styling leans on Tailwind tokens and CSS variables to drive the middle-grey default, optional light theme, and shared accent states via
--color-accent+ per-theme variants (--color-accent-dark/--color-accent-light, default#A47864).
- Google Analytics loads in production builds via the root layout when
NEXT_PUBLIC_GOOGLE_ANALYTICS_IDis set. - Add a
.env.localfile withNEXT_PUBLIC_GOOGLE_ANALYTICS_ID=G-CHMJYHNN47(or your property ID) for local testing. - CI builds the site before deploying (
skip_app_build: true), so expose the same variable to GitHub Actions (e.g. repository secret or environment variable) and mirror it in Azure Static Web Apps configuration for runtime parity. - Update
src/app/layout.tsxif additional event tracking is required.
- Add opt-in UX and event-level telemetry around gamut comparisons for privacy-friendly analytics.
- Offer gamut-volume comparisons and intersection metrics.
- Support importing user-defined color spaces via JSON or OCIO files.
- Add localisation & unit tests for the feedback modal behaviour.
- Provide a public roadmap page instead of the placeholder Trello link.
- Color primaries sourced via
colour-science(MIT). - Chromaticity rendering adapted from
react-cie-1931. - Middle-grey inspiration from the Kodak 18% reference card.
Maintained with care for the color community. Contributions welcome – please open an issue or PR with ideas.