Colors & swatches
The IDML Color and Swatch elements, the Model, Space and ColorValue spellings InDesign writes, and the reserved swatches every document carries.
<Color> holds the channel values; <Swatch> is a named entry with no values of its own. Page items name either by its Self id.
In short The palette lives in Resources/Graphic.xml. A <Color> carries a Model
(process, spot or registration), a Space (CMYK, RGB or LAB) and a ColorValue with
the numbers for that space. A spot colour also carries an alternate. A <Swatch> is an
entry such as Swatch/None, the "no paint" swatch. Every document carries the same handful
of reserved colours, marked by ColorOverride. Named tints are a third element, <Tint>,
covered on gradients & tints.
<Color>
| Attribute · Color | Values | Paged | paged.set |
|---|---|---|---|
| ColorEditable | false | true | written | |
| ColorOverride | Hiddenreserved | Normal | Specialblack | Specialpaper | Specialregistration | written | |
| ColorRemovable | false | true | written | |
| ColorValue | list (pt) | read · written | value |
| Model | Process | Spot | read · written | model |
| Name | text | read · written | name |
| Self | Color reference | read · written | |
| Space | CMYK | RGB | LAB | Gray | read · written | space |
| Visible | false | true | written | |
| AlternateColorValue | list (pt) | read · written | alternateValue |
The attributes that decide the colour are Model, Space, ColorValue and, for a spot
colour, AlternateSpace and AlternateColorValue. The rest is bookkeeping for the Swatches
panel: Name, ColorEditable, ColorRemovable, Visible, SwatchCreatorID and the colour
group a swatch belongs to.
Model
| Value | Meaning |
|---|---|
Process | Printed as a mix of the process inks. The model of almost every colour in real files. |
Spot | A named ink of its own, printed on its own plate. |
Registration | The reserved Color/Registration, which prints on every plate. |
Space and ColorValue
Space says how to read ColorValue, a space-separated list of numbers:
Space | ColorValue | Example |
|---|---|---|
CMYK | four percentages, C M Y K, each 0 to 100 | 0 100 100 0 |
RGB | three components, R G B, each 0 to 255 | 255 0 0 |
LAB | L from 0 to 100, then a and b, which can be negative | 46.27 20 33 |
InDesign spells the Lab space in capitals, LAB, and writes L with decimals. Of the 305
documents surveyed for this reference, every one has CMYK colours, 77 have RGB colours and
3 have Lab colours.
Spot colours and their alternate
A spot colour describes an ink that is not made from the process inks. Besides its own
Space and ColorValue, it carries an alternate: AlternateSpace and
AlternateColorValue, the colour to use where the ink itself is not available. InDesign
writes AlternateSpace="NoAlternateColor" with an empty AlternateColorValue on process
colours. Library spots, PANTONE colours for example, come with a Lab definition and a Lab
alternate of the same value: PANTONE 300 C in a surveyed file has Model="Spot",
Space="LAB", ColorValue="35.68627450980392 -10 -62", AlternateSpace="LAB" and the same
numbers again in AlternateColorValue.
A spot defined in CMYK carries a CMYK alternate. How a viewer shows a spot colour on screen is covered on spot & process color.
TintValue on a colour is not a tint
A named tint is written as a <Tint> element. A TintValue attribute on a <Color> is not
how InDesign stores one: InDesign drops the attribute when it opens the file, and the colour
appears at full strength. Write tints as
<Tint>.
In Paged: CMYK, RGB and Lab colours all render. A spot colour is previewed through its CMYK alternate when it has one, and otherwise from its Lab or RGB values. Mixed inks are recognised but not resolved to a colour. Paged also honours a
TintValueon a<Color>, which InDesign does not. Supported · verified Parsed, partly rendered
<Swatch>
| Attribute · Swatch | Values | Paged | paged.set |
|---|---|---|---|
| ColorEditable | false | not read | |
| ColorRemovable | false | not read | |
| Name | enum / text | read | |
| Self | Swatch reference | read | |
| Visible | true | not read | |
| SwatchCreatorID | integer | not read | |
| SwatchColorGroupReference | text | not read | |
| Color | reference | read |
In InDesign's files the <Swatch> element is used for Swatch/None, the "no paint" swatch.
A page item with FillColor="Swatch/None" has no fill: it is transparent there. The same
spelling turns off a stroke. A Color attribute on a <Swatch> that names a <Color> makes
the swatch an alias for that colour; one surveyed document has one.
The reserved colours
InDesign writes the same reserved entries into every document's Graphic.xml. They are
<Color> elements whose ColorOverride marks their role:
Self | ColorOverride | Role |
|---|---|---|
Color/Black | Specialblack | Process black, 100 % K. Not editable. |
Color/Paper | Specialpaper | The colour of the paper. A fill of Paper covers what lies beneath it with the paper colour; it is not "no fill". |
Color/Registration | Specialregistration | Prints on every plate, for crop and registration marks. Model="Registration". |
Color/Cyan, Color/Magenta, Color/Yellow | Hiddenreserved | The process primaries, hidden from the Swatches panel (Visible="false"). |
| user colours | Normal | Everything else. |
Black and Paper appear in all 305 surveyed documents, the other reserved entries in the 271
that InDesign wrote; the remaining files come from a generator. A reader should still resolve Color/Black,
Color/Paper and Swatch/None by name when a file leaves them out.
In Paged: the reserved swatches are recognised by their ids, so a file that omits them still resolves them. Parsed, not rendered
A color, defined and applied
The example adds one <Color> to the palette, a process CMYK red, 0 100 100 0, and fills a
rectangle with it by naming its id in FillColor.
A CMYK colour defined in Graphic.xml and applied to a rectangle by FillColor.
Change ColorValue and the rectangle follows: the rectangle names the colour, and the
numbers live in one place.
Frequently asked questions
What is the difference between <Color> and <Swatch>?
A <Color> carries a model, a space and channel values. A <Swatch> carries no values; in
InDesign's files it is the reserved Swatch/None, which means no paint.
How does IDML spell the Lab colour space?
Space="LAB", in capitals, with ColorValue holding L, a and b, for example
46.27 20 33.
What does AlternateSpace="NoAlternateColor" mean?
That the colour has no alternate. InDesign writes it on process colours, with an empty
AlternateColorValue. Spot colours carry a real alternate, in Lab or CMYK.
Can I make a tint by adding TintValue to a <Color>?
No. InDesign ignores that attribute and shows the colour at full strength. A named tint is a
<Tint> element with BaseColor and TintValue.
Does a document have to define Black, Paper and None? InDesign always writes them. A reader should resolve them by name anyway, because files written by other tools sometimes leave them out.
Color & swatches
How an IDML document keeps its colours in one palette in Graphic.xml, which elements the palette holds, and how a fill or stroke resolves to a colour.
Gradients & tints
The IDML Gradient, GradientStop and Tint elements, how a shape places a gradient, and the per-use FillTint, including its -1 "no tint" sentinel.