Colors & swatches
The <Color> and <Swatch> elements — their attributes, the four color spaces, and the reserved built-ins every document carries.
<Color> holds the actual channel values; <Swatch> is the named handle that points at one.
In short: <Color> and <Swatch> are the two leaf entries of the IDML
palette in Resources/Graphic.xml. A <Color> carries a color model, a color
space, and the channel values for that space — CMYK, RGB, Lab, or Gray. A
<Swatch> is a thin named wrapper that usually just references a <Color>. Both
are keyed by their Self id, and that id is exactly what a shape or run of text
names in its FillColor or StrokeColor. This page is the attribute-level
reference for both, including the four color spaces and the built-ins every
document carries.
<Color> and <Swatch> are the two leaf entries of the palette in
Resources/Graphic.xml. A <Color> holds actual channel values; a <Swatch>
is a named handle that usually points at one. Both are keyed by their Self id,
and that id is what a shape or run of text names in its FillColor /
StrokeColor.
<Color>
A <Color> names a color model (Model), a color space (Space), and the
channel values for that space (ColorValue). The parser reads these three plus
the spot-color fallback attributes and ignores the editor-only bookkeeping
(ColorEditable, ColorRemovable, Visible, SwatchCreatorID).
| Attribute · Color | Type / values | Support | Notes |
|---|---|---|---|
| Self | string id | Supported | The lookup key, conventionally "Color/<name>". Everything that paints this color references this id. |
| Name | string | Supported | Human-readable swatch name; informational for the renderer. |
| Model | Process | Spot | MixedInk | Supported | Process is the default. Spot marks a named ink previewed via its CMYK alternate. MixedInk / MixedInkGroup are recognized but collapse to an unhandled model. |
| Space | CMYK | RGB | LAB | Gray | Supported | Selects how ColorValue is interpreted. CMYK, RGB and Gray convert to device color; Lab is parsed but only the spot CMYK-alternate path renders it. |
| ColorValue | space-separated numbers | Supported | The channels for Space: CMYK = four 0–100 percentages; RGB = three 0–255; Lab = L 0–100, a/b −128–127; Gray = one 0–100. |
| AlternateSpace | CMYK | RGB | LAB | … | Supported | Color space of the fallback a spot swatch carries. The renderer previews spot colors through this when it is CMYK. |
| AlternateColorValue | space-separated numbers | Supported | The fallback channels in AlternateSpace. For a CMYK alternate, four percentages. |
| TintValue | number 0–100 | Supported | A swatch-level tint baked into a spot color ("PANTONE 286 at 50%"). Multiplied into the CMYK alternate before conversion. −1 (Adobe’s "unset") and out-of-range values are treated as absent. |
| AlphaPercentage / Alpha | number | Supported | Optional opacity on the swatch. AlphaPercentage is 0–100; a bare Alpha may be 0–100 or a 0–1 unit float. Absent ⇒ opaque. |
| ColorOverride | Normal | Specialpaper | Specialblack | … | Parsed, not yet rendered | Marks the reserved built-ins. The renderer keys the built-ins by name rather than branching on this attribute. |
| BaseColor | string id | Not yet parsed | Used by <Tint> to point at the color it is a percentage of; not read off <Color> itself. |
The four color spaces
Space decides what ColorValue means and how the color reaches the screen:
- CMYK — four percentages
C M Y K, each 0–100. The primary print path; the renderer sends these through ICC conversion (or a naive fallback). Pure red is0 100 100 0. - RGB — three components
R G B, each 0–255. Converted straight to device color. - Lab —
L a bwith L in 0–100 and a/b in −128–127. Parsed and stored, but the renderer only produces a visible color for Lab when it arrives through a spot color's CMYK alternate. Parsed, not yet renderedLab as a primary space - Gray — one value 0–100. Rendered as an achromatic gray.
<Swatch>
A <Swatch> is a named entry that the palette can reference indirectly. The
parser captures its id, its name, and — when present — the <Color> it wraps, so
a FillColor that names a swatch resolves through to the underlying color in one
hop.
| Attribute · Swatch | Type / values | Support | Notes |
|---|---|---|---|
| Self | string id | Supported | The lookup key, e.g. "Swatch/None". |
| Name | string | Supported | The swatch name shown in the UI. |
| Color | string id | Supported | Optional reference to the <Color> this swatch wraps; resolve() follows it one level. |
The single most-referenced swatch is Swatch/None — the explicit "no fill" /
"no stroke" handle. A frame with FillColor="Swatch/None" is transparent there;
it is not an error and not a color.
The reserved built-ins
A document does not have to define everything it uses. InDesign guarantees a
fixed set of swatches and colors exist whether or not they appear in
Graphic.xml, and the renderer treats them by name:
- None — the transparent "no paint" swatch.
- Paper — the substrate color (white by default); a fill of Paper knocks out to the page color, it is not literally "no fill".
- Black — process black.
- Registration — paints in every separation at once (for crop marks and the like).
In addition, the format reserves the three hidden process primaries — Cyan, Magenta, and Yellow — which a document may reference but cannot redefine. Because these are guaranteed, an example that omits them still resolves correctly.
A color, defined and applied
The example below adds one <Color> to the palette — a process CMYK red,
0 100 100 0 — and a rectangle whose FillColor names it. The rectangle has no
text and no font; it is pure fill, so the live view renders it directly.
A new CMYK swatch in Graphic.xml, applied to a rectangle by FillColor.
Resources/Graphic.xml<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Graphic xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
<Color Self="Color/Black" Model="Process" Space="CMYK" ColorValue="0 0 0 100" ColorOverride="Specialblack" Name="Black" ColorEditable="false" ColorRemovable="false" Visible="true"/>
<Color Self="Color/Paper" Model="Process" Space="CMYK" ColorValue="0 0 0 0" ColorOverride="Specialpaper" Name="Paper" ColorEditable="true" ColorRemovable="false" Visible="true"/>
<Color Self="Color/Red" Model="Process" Space="CMYK" ColorValue="0 100 100 0" ColorOverride="Normal" Name="Red" ColorEditable="true" ColorRemovable="true" Visible="true"/>
</idPkg:Graphic>
Change ColorValue in the palette and the rectangle's color follows, because the
shape only ever names the swatch — the channel values live in one place.
Frequently asked questions
What is the difference between a <Color> and a <Swatch>?
A <Color> carries the real channel values — a model, a space, and the numbers
for that space. A <Swatch> is a named handle that usually just references a
<Color>, so a FillColor naming a swatch resolves through to the underlying
color in one hop. The reserved Swatch/None is the common exception: it wraps no
color and means "no fill."
Which color spaces does the renderer support for a <Color>?
Space can be CMYK, RGB, Lab, or Gray. CMYK, RGB, and Gray all convert to device
color; CMYK is the primary print path and goes through ICC conversion. Lab is
parsed and stored, but the renderer only produces a visible color for it when it
arrives through a spot color's CMYK alternate.
What is Swatch/None, and is it an error?
Swatch/None is the reserved "no paint" handle. A frame with
FillColor="Swatch/None" is simply transparent there — it is not an error and not
a color, just the explicit absence of one.
Does a document have to define every color it references?
No. InDesign® guarantees a fixed set of built-ins exist whether or not they appear
in Graphic.xml — None, Paper, Black, and Registration — and the format also
reserves the hidden process primaries Cyan, Magenta, and Yellow. The renderer keys
these by name, so an example that omits them still resolves correctly.