14 Chroma – Import / Export

12 min read

Where you bring palettes and gradients in from external tools and push them out to formats the rest of your pipeline can use.

Summary

Color assets travel across tools. A palette authored in Aseprite needs to make it into Unity; a gradient downloaded from Lospec needs to be a ColorGradientAsset the rest of the project can address; a Photoshop .grd library shared by an art director needs to populate a project’s gradient sidebar without anyone hand-transcribing stop colors. The Import / Export surface in Chroma is the layer that handles those round-trips.

Every importer and exporter implements one of four small interfaces (IPaletteImporter, IPaletteExporter, IGradientImporter, IGradientExporter) that the editor toolbars and the library sidebar dispatch on by file extension. The architecture is intentionally pluggable, but the built-in coverage is the real story: it covers every common open-format palette interchange plus Adobe’s two major proprietary formats on the input side, and pairs them with useful artifact-generating exporters on the output side (CSS variables for web embeds, C# color constants for code use, Chroma JSON for full-fidelity round-trip).

On the gradient side, the surface is smaller (because gradient file formats are rarer in the wild) but deeper where it counts: the Photoshop .grd importer handles both binary layouts that have shipped since Photoshop 6, walks the Adobe Action Descriptor format used in GRD5, and reads the multi-gradient library files that artists routinely ship as bundles. Chroma JSON (.cgradient) handles full-fidelity round-trip for everything the Gradient Editor can author.

  • Import palettes built in any of the common tools (Aseprite, GIMP, Photoshop, Lospec.com, web hex lists) as ColorPaletteAsset files.
  • Export palettes to formats consumed by other tools: ASE (Adobe Swatch Exchange) for Adobe, GPL (GIMP Palette) for GIMP, JSON for Lospec, CSS variables for web, C# color constants for code, Chroma JSON for round-trip.
  • Import single-gradient or multi-gradient Photoshop .grd libraries with full color-space conversion.
  • Round-trip Chroma gradients (including per-stop interpolation, blend modes, alpha rail, Reduction, mute flags) through the .cgradient JSON format for version control, backup, or sharing.

Features

  • Six palette importers. Chroma reads ASE (Adobe Swatch Exchange), GPL (GIMP Palette), Lospec JSON, ACT (Adobe Color Table), hex lists, and Chroma JSON (.cpalette).
  • Six palette exporters. Chroma writes ASE, GPL, Lospec JSON, CSS variables, C# color constants, and Chroma JSON (.cpalette).
  • Two gradient importers. Chroma reads Chroma JSON (.cgradient) and Photoshop GRD (.grd, both GRD3 and GRD5 layouts).
  • One gradient exporter. Chroma writes Chroma JSON (.cgradient).
  • Format dispatch by extension. ChromaIORegistry matches the file extension to the registered importer/exporter, so you don’t pick “which importer to use” – the file’s extension picks for you.
  • Import from the clipboard, no file needed. Actions > New from Clipboard on the Palette Editor reads colors straight out of copied text: CSS custom properties, SCSS variables, Tailwind config objects, JSON arrays, comma-separated or bare hex lists, the CSS rgb() / hsl() functions, CSS color names, a pasted GIMP palette block, and every format the Copy Selected As submenu writes. This is the path for colors that arrive in a message or a stylesheet rather than as a file, and it makes the copy formats a round trip rather than a one-way export.
  • Three invocation paths. Reach import and export from the Palette Editor toolbar (Actions > Import / Export), from the Gradient Editor toolbar (same path), or from the Library sidebar (drop a file onto the sidebar to auto-import). The toolbar Actions menu exposes both import and export; the library sidebar handles import via drop only.
  • Last-used directory persistence. The Save As panel for exports and the Open File panel for imports remember the last directory used, with one directory shared by all palette formats and a separate one for gradient formats, so iterative export workflows don’t restart from Assets/ each time.
  • Post-import asset activation. Imported files become new ColorPaletteAsset or ColorGradientAsset assets under the configured color directories (set in Project Settings > Scylla; see Preferences). The new asset is auto-opened in the corresponding editor tab and pinged in the Project window.
  • Multi-gradient picker for Photoshop GRD (Photoshop Gradient format) libraries. Photoshop gradient files routinely bundle dozens of gradients per .grd file (a “gradient library”); Chroma opens a multi-select picker (ChromaGradientImportPickerWindow) so you pick which entries to import as separate ColorGradientAsset files.
  • Color-space conversion at import. Imported colors are converted into sRGB regardless of the source format’s color space (CMYK, Lab, HSB, Grayscale all resolve to sRGB on import).
  • Locale-invariant JSON. Chroma JSON read and write use invariant culture for number formatting, so .cpalette and .cgradient files written on a French machine open cleanly on a German machine (no decimal-comma vs decimal-point breakage).

Recipes

Each recipe below walks through one common file interchange situation on its own, so there’s no need to read them in order. Find the one that matches what you’re trying to do and start there.

Import a palette from an external editor

Problem. Your pixel artist has been building the game’s palette in Aseprite or GIMP, or you’ve downloaded a community palette from Lospec.com, and you need it inside Chroma as a ColorPaletteAsset without re-entering every color by hand.

Solution. Open the Palette tab in Chroma, click the Actions dropdown in the toolbar, and choose Import, then pick the format matching your file:

  • ASE (Adobe Swatch Exchange) (.ase) – Aseprite exports ASE directly from its palette panel. Also works for swatches exported from Photoshop, Illustrator, or InDesign.
  • GPL (GIMP Palette) (.gpl) – GIMP exports this as its native palette format; Inkscape and Krita also produce it, and most palette download sites offer a GPL option.
  • Lospec JSON (.json) – Lospec.com uses this format for its palettes; the site’s download button offers it directly.
  • ACT (Adobe Color Table) (.act) – Older Adobe tools and “Save for Web” indexed-color exports use this legacy fixed-size format.
  • Hex list (.hex, .txt) – Lists one hex color per line; works for palettes copied out of a chat message, a code comment, or any hand-curated text file.
  • Chroma JSON (.cpalette) – This is Chroma’s own format. Use it when moving a palette between projects or restoring from a backup.

After clicking the menu item, an Open File panel appears pointing at the last directory you used for a palette import or export. Pick the file; Chroma creates a new ColorPaletteAsset under your configured color directory, opens it in the Palette tab, and pings it in the Project window.

Export a palette to another tool

Problem. You’ve finished authoring a palette in Chroma and need to get it into an external tool. Your web team wants CSS variables; your programmer wants a C# class they can reference directly in code; the artist using GIMP wants a .gpl file.

Solution. Load the palette in the Palette tab, click Actions, and choose Export, then pick the format:

  • ASE (.ase) – Opens cleanly in Photoshop, Illustrator, InDesign, and Aseprite. Every entry is exported as an sRGB swatch.
  • GPL (.gpl) – Opens in GIMP, Krita, and Inkscape. Writes a standard-compliant file with the palette’s name in the Name: header.
  • Lospec JSON (.json) – Lospec.com accepts this format for palette submissions. Note that per-swatch IDs and tags aren’t carried by the Lospec schema; only the hex colors and the palette name travel.
  • CSS variables (.css) – Writes one --variable-name: #RRGGBB; declaration per swatch (#RRGGBBAA when the swatch carries alpha), wrapped in a :root { ... } block. Swatch IDs become lowercase CSS variable names, with spaces and other punctuation turned into hyphens. It’s the right choice for web projects or style-guide pipelines that consume CSS custom properties.
  • C# color constants (.cs) – Generates a self-contained public static class [PaletteName] with one public static readonly Color field per swatch, named after the swatch ID. The file compiles without additional imports beyond UnityEngine and can be dropped straight into Assets/. Use this when you want to reference palette colors from code without going through the ColorPaletteAsset runtime API.
  • Chroma JSON (.cpalette) – Full fidelity for the palette data: name, description, per-swatch color, ID, role, lock state, and per-swatch tags all travel. The current schema is version 2, which stores each swatch’s ID under the key id; files written by earlier versions (version 1, with the key name) still import. Palette-level tags stay on the asset and are not written to the file. Use for backups, version control, and cross-project sharing.

A Save As panel appears pointing at the last directory you used for a palette import or export. Pick a location; the file is written to disk. Whether it lands in Assets/ and becomes a project file is up to where you save it.

Round-trip a palette through Chroma JSON

Problem. You want to put a palette into version control so diffs are meaningful, share it between two Unity projects without going through Unity’s meta-file machinery, or keep a backup that restores every detail the Palette Editor can author (IDs, roles, lock states, tags).

Solution. Export the palette to Chroma JSON via Actions > Export > Chroma Palette JSON (.cpalette). The file is pretty-printed with stable key ordering. A swatch color change shows as a one-line diff in git; reordering swatches shows as multiple lines but a clear pattern. To restore, import via Actions > Import > Chroma Palette JSON (.cpalette).

The round-trip is byte-for-byte identical on the palette data (modulo JSON whitespace). Both read and write use invariant culture for number formatting, so the file opens cleanly on any locale.

Import a gradient from Photoshop

Problem. Your art director has a .grd library they’ve been building in Photoshop and wants to share it with the rest of the team. The file contains dozens of gradients, maybe a mix of solid and noise types, stops in various color spaces, and foreground/background sentinel stops.

Solution. Open the Gradient tab, click Actions > Import > Photoshop Gradient (.grd). An Open File panel appears; pick the .grd file.

  • Single-gradient files import directly into a new ColorGradientAsset.
  • Multi-gradient library files open a multi-select picker (ChromaGradientImportPickerWindow). Check the entries you want; each becomes a separate ColorGradientAsset. Cancel to abort without importing anything.

Color-space conversion happens automatically at import: RGB, HSB, CMYK, Lab, and Grayscale stops all resolve to sRGB. Foreground and background sentinel stops (where Photoshop substitutes the live FG/BG color at render time) are substituted as black/white and flagged on the parsed result. If the substitution isn’t what you wanted, re-color those stops in the Gradient Editor after import.

Round-trip a gradient through Chroma JSON

Problem. You want to back up a gradient, share it between projects, or put it in version control so per-stop changes are visible as diffs.

Solution. Load the gradient in the Gradient tab and choose Actions > Export > Chroma Gradient JSON (.cgradient). The .cgradient file is pretty-printed JSON carrying every field the Gradient Editor can author: name, description, mode (Smooth / Stepped), color space, Reduction and SteppedReduction values, per-color-stop (offset, color, name, interpolation, midpoint, blend mode, IsMuted), and per-alpha-stop (offset, alpha, midpoint, interpolation). To restore, import via Actions > Import > Chroma Gradient JSON (.cgradient).

The blendMode field is a Chroma extension; older .cgradient files written before blend modes were added default to Normal on import, so backward compatibility is maintained.

Import a palette via drag and drop

Problem. You have a supported palette file on disk or in the Project window and want to import it as fast as possible without navigating menus.

Solution. Drop the file onto the Library sidebar from disk or from the Project window. The format is auto-detected by extension via ChromaIORegistry; the importer runs without surfacing any menu. The new ColorPaletteAsset appears in the sidebar immediately via the live-refresh path.

The dispatch is identical to using Actions > Import > [format], except that the library-drop path skips the Open File panel since the file is already selected. A multi-gradient .grd library is the one exception: a drop imports only its first gradient and does not open the picker, so use Actions > Import to choose entries from a library file.

Tips and pitfalls