Color & swatches
The document's palette — how named colors, gradients, and tints are defined once and referenced everywhere.
In an IDML document, color lives in one shared palette — every fill and stroke just points at it by name.
In short: An IDML document keeps all of its color in a single part,
Resources/Graphic.xml — a flat palette of named colors, gradients, and tints.
Nothing on a page carries its own raw channel values; a rectangle, a run of text,
or a frame border simply names a swatch by id, and the swatch holds the actual
color. That one indirection is the whole idea: change a swatch once and everything
that references it follows. This chapter explains how that palette is built, how a
fill resolves to a real color, and where Paged's renderer is faithful or still
approximate.
Every visible fill and stroke in an IDML document points at the palette: a
shared table of named colors, gradients, and tints that lives in one part,
Resources/Graphic.xml. Nothing on a page carries its own raw color. A
rectangle, a piece of text, a frame border — each names a swatch by id, and the
swatch holds the actual channel values. Change the swatch once and everything
that references it moves with it.
This is why color is a cross-cutting chapter rather than a property of any one
element. The same Color/Red can fill a rectangle,
tint a run of text, and seed a gradient stop. The reference parts that describe
shapes and text take the palette as given; this chapter is where the palette
itself is defined.
The palette is a small set of element kinds
Resources/Graphic.xml is a flat list. The parser walks it once and keys what
it finds by each element's Self id, so a later FillColor="Color/Red" is a
direct lookup. Four kinds matter for rendering:
<Color>— a single color in one of four spaces (CMYK, RGB, Lab, Gray), marked eitherProcessorSpot. The workhorse of the palette.<Swatch>— a thin named wrapper. The reserved "None" swatch is one; most others just point at a<Color>.<Gradient>— a blend between two or more stops, each of which references a<Color>. A gradient owns no color of its own.- tints — "this color at N%". Tint shows up two ways: as a swatch-level value
on a spot
<Color>, and as a per-useFillTinton the thing being painted.
A handful of other constructs — mixed inks, mixed-ink groups, and color groups — are part of the format and the parser reads them, but the renderer does not yet give them their full meaning. Those gaps are called out where they belong rather than hidden.
How a fill resolves
When a shape says FillColor="Color/Red", the renderer looks Color/Red up in
the palette. If the id names a <Color>, it converts that color's channel values
to device color for display. If it names a <Gradient>, the renderer resolves
each stop's referenced color and builds a gradient paint. If it names a
<Swatch> such as Swatch/None, that is the explicit "no fill" case. The id is
the contract; the palette is the source of truth.
The example below is the smallest version of that story: one new <Color>,
applied to one rectangle.
A CMYK red defined once in the palette, 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>
Where to go next
- Colors & swatches — the
<Color>and<Swatch>attributes, the reserved built-ins, and what each space means. - Gradients & tints —
<Gradient>,<GradientStop>, and the two ways a tint reaches a color. - Spot & process color — why spot inks are previewed through a CMYK alternate, how ICC conversion fits in, and the honest edges of what the renderer reproduces.
The ordering here follows a reader building up from a flat color to gradients to the press-oriented spot/process distinction — not the source spec's section order (clean-room §6.1).
Frequently asked questions
Where does an IDML document store its colors?
All of them live in one part, Resources/Graphic.xml, as a flat palette of
<Color>, <Swatch>, and <Gradient> entries. The pages and shapes themselves
hold no channel values — they reference palette entries by their Self id.
How does a shape's fill turn into an actual color?
A shape names a swatch in its FillColor (or StrokeColor), and the renderer
looks that id up in the palette. If it resolves to a <Color>, the channel values
are converted to device color; if it resolves to a <Gradient>, each stop's
referenced color is resolved and a gradient paint is built; if it resolves to
Swatch/None, that is the explicit "no fill" case.
Why is color a separate chapter rather than part of shapes or text?
Because the palette is cross-cutting: the same Color/Red can fill a rectangle,
tint a run of text, and seed a gradient stop. The parts that describe shapes and
text take the palette as given, so it makes sense to define the palette itself
once, in its own place.
Tables in the text flow
What it means for a table to be anchored in a story's paragraph — how it draws where the flow reaches it, breaks across threaded frames, and repeats its header and footer rows.
Colors & swatches
The <Color> and <Swatch> elements — their attributes, the four color spaces, and the reserved built-ins every document carries.