Developer Handoff & Export

ChromaForge is the color compiler for developers and designers. It turns color inspiration into perceptual palettes, validates accessibility, and ships production-ready design-system tokens, Figma handoff, framework exports, and CI-friendly audit output.

Compile tokens, review component previews, create Figma handoff, export frameworks, and run CI audits.

Core idea: Start with color inspiration, forge into a perceptual palette, validate accessibility, & ship design-system tokens & exports.

Developer Handoff

Developer Handoff is the Pro workflow for compiling a palette into theme variants, roles, component tokens, Figma Variables, framework exports, and production previews.

Free view

  • Shows a Pro Workflow summary.
  • Highlights 3 theme modes and 3 token layers.
  • Lists Pro features such as theme matrix, semantic tokens, component tokens, AA contrast repair, Component Preview Lab, Figma handoff, and advanced exports.
  • Includes an Unlock Pro button.

Pro workflow

  1. Choose a theme variant: Light, Dark, or High Contrast.
  2. Review role token count, AA check coverage, and best pair metric.
  3. If semantic pairs fail AA, tap Auto-Fix AA.
  4. Use Figma Handoff when the design team needs variables and modes.
  5. Choose a role preset for the target system.
  6. Inspect the Theme Matrix across all variants.
  7. Use the Component Preview Lab to see the palette in real UI structures.
  8. Compare against another palette in Palette Diff.
  9. Review primitive, semantic, and component token lists.
  10. Open Export and share the final format.

Figma Handoff

The Figma Handoff block shows one color collection, three modes, and the number of variables ChromaForge will share. Tap Share Variables to export Figma Variables JSON.

Layer What it contains Figma mapping
Primitive Direct palette stops such as palette-50 and palette-500. color/primitive/... variables with the same value in every mode.
Semantic Purpose-based roles such as background, foreground, surface, primary, warning, and danger. color/semantic/... variables with Light, Dark, and High Contrast mode values.
Component UI-specific roles such as button primary background, input focus border, link foreground, and focus-ring outline. color/component/... variables expressed as aliases to semantic roles, with resolved fallback colors included.
Current scope: Figma Variables is an export/handoff payload designed for plugin or automation import. It is not live Figma sync inside the app.

Share CSS shortcut

The Developer Handoff header includes Share CSS, which shares Semantic CSS for the current palette.

Tokens & Theme Variants

Primitive tokens

Primitive tokens are direct palette stops. ChromaForge names them like palette-50, palette-100, palette-200, and so on when the stop count fits the standard 50-950 scale. If a palette has more stops, it uses numeric names such as 100, 200, 300.

Semantic tokens

Role Token Use
Background--color-backgroundBase page or app canvas.
Foreground--color-foregroundPrimary text and icons.
Surface--color-surfaceCards, panels, grouped areas.
Surface Raised--color-surface-raisedElevated surfaces, popovers, dialogs.
Border--color-borderBorders, dividers, subdued copy, grids.
Primary--color-primaryPrimary actions and brand tint.
Secondary--color-secondarySecondary actions and supporting accents.
Accent--color-accentLinks, focus rings, expressive accents.
Success--color-successPositive status and success markers.
Warning--color-warningCaution status and warnings.
Danger--color-dangerErrors, destructive actions, failure status.

Component tokens

Component tokens bind semantic roles to UI use cases, such as button-primary-background, input-focus-border, alert-warning-background, link-default-foreground, and focus-ring-default-outline. Each row shows the token name, semantic reference, and hex value.

Theme variants

Variant How ChromaForge maps it Color scheme
Light Uses the lightest stop as background, selects the highest-contrast foreground, and builds surfaces slightly below the background. light
Dark Uses the darkest stop as background, selects the highest-contrast foreground, and builds progressively raised surfaces. dark
High Contrast Starts from an even darker base, chooses strong foreground contrast, and lifts surfaces for clearer boundaries. dark

Role Presets

Role presets translate ChromaForge semantic roles into the naming conventions expected by common UI systems.

Preset Aliases generated
ChromaForge color.background, color.foreground, color.surfaceRaised, and all native semantic roles.
shadcn/ui background, foreground, card, popover, primary, secondary, muted, accent, destructive, border, input, and ring with foreground variants.
Material 3 primary, on-primary, primary-container, secondary, tertiary, surface, surface-container-high, on-surface, outline, error, and on-error.
Apple UI systemBackground, secondarySystemBackground, tertiarySystemBackground, label, secondaryLabel, tintColor, separator, systemFill, systemGreen, systemYellow, and systemRed.
Data Viz chart-background, chart-grid, chart-label, and categorical chart-series-N colors.
Workflow tip: Pick the role preset before exporting framework-specific code. It helps you notice where a palette does not have enough useful accents for the target system.

Component Preview Lab

The Component Preview Lab renders semantic tokens in a compact product UI so you can evaluate real use cases, not only swatches.

Previewed patterns

  • Account card with headline and supporting copy.
  • Primary and secondary buttons.
  • Email input with focus ring.
  • Success, warning, and danger badges.
  • Sidebar navigation with selected and unselected rows.
  • Progress bars and chart bars.
  • Invite member modal/dialog pattern.
  • Status list with queued, running, and failed markers.
  • Code surface showing a theme token path.

How to review a component preview

  1. Choose a theme variant in Developer Handoff.
  2. Scan text readability first: headings, labels, helper copy, and code text.
  3. Check action hierarchy: primary should be obvious; secondary should not disappear.
  4. Check focus and status colors: ring, success, warning, and danger need enough separation from the background.
  5. If the preview fails, use Auto-Fix AA, change stops, or generate a different harmony.

Palette Diff

Palette Diff compares the current palette against another palette in your library. It measures both primitive stop changes and semantic token changes using perceptual distance.

Compare palettes

  1. Open Developer Handoff.
  2. In Palette Diff, choose another palette from the Compare picker.
  3. Review Changed, Largest, and From metrics.
  4. Inspect the highest semantic changes and stop changes.
  5. Use the before/after swatches to decide whether the difference is intentional.

What the distance means

Distance is calculated in OKLab-style perceptual space. Larger values usually mean a more visible shift in lightness or color. A low stop distance can still produce a meaningful semantic shift if the changed color becomes background, foreground, primary, or danger.

Export Formats

The Export panel shows the selected format as selectable monospaced text. If the format is available, tap Share to send it to Files, Mail, Messages, another app, or your development workflow. Free includes 5 basic exports; Pro unlocks unlimited exports and advanced handoff formats.

Free exports

Free exports include JSON, Mandelbrot Metal, and raw CSS Variables. The Free export counter advances when you share one of these formats. When all 5 free exports are used, open Pricing to unlock unlimited exports.

Format What it contains
JSON Full ChromaForge palette model with name, subtitle, kind, color space, LUT resolution, notes, recipe, dates, favorite state, stops, positions, colors, and locks.
Mandelbrot Metal Palette JSON with schema version, name, color space, normalized stop positions, RGB components, and optional notes.
CSS Variables Raw :root variables named from the palette slug and stop index.

Pro exports

Format Use it when
Modern CSSYou want hex fallbacks, OKLCH values, Display-P3 strings, @supports, light-dark(), and color-mix() helpers.
Semantic CSSYou need light, dark, high-contrast, prefers-color-scheme, semantic variables, and component variables.
TailwindYou need a classic Tailwind config extension with palette and app colors.
Tailwind v4You need CSS-first @theme and @theme inline output.
shadcn/uiYou need OKLCH variables for :root, .dark, and shadcn @theme inline aliases.
SwiftUIYou need an extension Color with primitive and semantic static colors.
Swift AssetsYou need a plan for creating .colorset entries in Assets.xcassets for light, dark, and high contrast.
SassYou need Sass variables for primitive stops and semantic roles.
Android XMLYou need <color> resources for Android light and dark roles.
ComposeYou need Jetpack Compose Material 3 lightColorScheme and darkColorScheme.
FlutterYou need Dart ColorScheme definitions for light and dark themes.
React NativeYou need a typed theme object with light, dark, and high-contrast colors.
DTCG 2025.10You need structured design-token JSON with $schema, $type, $value, and semantic groups.
Tokens StudioYou need JSON shaped for Tokens Studio-style workflows.
Style DictionaryYou need JSON for a Style Dictionary token build pipeline.
Figma VariablesYou need a Figma-oriented JSON handoff with one color collection, Light/Dark/High Contrast modes, primitive colors, semantic tokens, component aliases, code syntax, and resolved color values.
CSVYou need spreadsheet-friendly rows with index, position, hex, red, green, blue, and locked state.

Export a palette

  1. Open the Export disclosure panel.
  2. Choose a format from the picker.
  3. If the format is Pro-only and you are on Free, tap Unlock Export or choose a free format.
  4. If the Free export counter has reached 5/5, tap Upgrade for Unlimited Exports.
  5. Review the generated text.
  6. Tap Share to send the export where you need it.

CLI / CI Audit

The repository includes a starter command-line audit script at Tools/chromaforge-cli.swift. It extracts hex colors from CSS, JSON, or text, calculates every foreground/background pair, reports contrast coverage, and exits non-zero when not every pair passes AA normal-text contrast.

On Mac, open Tools > CLI Utility inside ChromaForge to review common commands, or choose Tools > Copy CLI Audit Command to copy a starter audit command to the pasteboard.

Run the audit

swift Tools/chromaforge-cli.swift audit path/to/tokens-or-css-file.css

What the CLI reports

  • File name being audited.
  • Number of unique colors found.
  • Total pair count.
  • AA normal coverage at 4.5:1.
  • AA large / non-text coverage at 3:1.
  • AAA coverage at 7:1.
  • Weakest foreground/background pair.
  • Strongest foreground/background pair.

Use it as a CI gate

  1. Export CSS or tokens from ChromaForge.
  2. Commit the file to your design-system or app repository.
  3. Add the Swift CLI command to your CI workflow.
  4. Fail the build when the script exits non-zero.
  5. Return to ChromaForge, repair or adjust colors, export again, and rerun the audit.
Scope: The starter CLI audits hex colors. The in-app website importer and exporters understand more color syntaxes than the starter CLI.