IDML Reference / Color & swatches
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.
Reviewed against engine v0.71.9
A gradient is a swatch made of stops that point at colours; a tint is a colour at reduced strength, either as a named <Tint> swatch or as a FillTint on one object.
In short A <Gradient> in Resources/Graphic.xml has a Type (Linear or Radial)
and two or more <GradientStop> children, each naming a colour, a Location and a
Midpoint. The shape that uses the gradient decides its direction and extent with
GradientFillAngle, GradientFillStart and GradientFillLength. A tint reaches a colour two
ways: a named <Tint> swatch with BaseColor and TintValue, or a FillTint percentage on
the painted object. FillTint="-1" means "no tint": use the swatch as it is.
<Gradient>
| Attribute · Gradient | Values | Seen in |
|---|---|---|
| Name | text | 100% |
| Self | Gradient reference | 100% |
| Type | Linear | Radial | 100% |
| ColorEditable | true | 100% |
| ColorRemovable | true | 100% |
| SwatchCreatorID | integer | 100% |
| Visible | false | true | 100% |
| SwatchColorGroupReference | text | 97% |
A shape paints a gradient by naming it, FillColor="Gradient/SkySun", exactly as it names a
colour. The gradient itself holds only its Type and its stops. 272 of the 305 surveyed
documents carry at least one gradient swatch; 5 of them have a radial one.
<GradientStop>
| Attribute · GradientStop | Values | Seen in |
|---|---|---|
| Location | integer / real | 100% |
| StopColor | Color reference | 100% |
| Midpoint | integer / real | 100% |
| Self | text | 100% |
StopColornames a colour in the palette bySelfid. A stop has no colour of its own, so editing the colour changes every gradient that uses it.Locationis the stop's position along the gradient, in percent from 0 to 100.Midpointis where the blend between the previous stop and this one reaches its halfway colour, in percent of the distance between them.50is an even blend. The first stop has nothing before it; InDesign writes50there. In the surveyed files every midpoint other than 50 sits on a stop after the first, most often on the last one.
Stops are listed in order of Location.
Placing a gradient on a shape
The gradient swatch has no direction or size. The shape that uses it does, so one gradient can sit differently on every shape:
| Attribute · Rectangle | Values | Seen in |
|---|---|---|
| GradientFillAngle | number (degrees) | 93% |
| GradientFillStart | list (pt) | 93% |
| GradientFillLength | length (pt) | 93% |
| GradientFillHiliteAngle | integer / real | 93% |
| GradientFillHiliteLength | integer / real | 93% |
GradientFillAngle, in degrees. At 0 the gradient runs left to right, the first stop on the left. Positive angles turn it counter-clockwise on the page: at 90 it runs from bottom to top, with the first stop at the bottom.GradientFillStartandGradientFillLengthgive the start point of the gradient, in the shape's own coordinates, and its length in points. For a radial gradient the start is the centre and the length the radius.GradientFillHiliteAngleandGradientFillHiliteLengthare written alongside; they are 0 in nearly every surveyed file.
Strokes have the same set: GradientStrokeAngle, GradientStrokeStart,
GradientStrokeLength and the two hilite attributes.
A two-stop linear gradient, Sun (yellow) to Sky (blue), on a rectangle with GradientFillAngle="90". InDesign draws the first stop, Sun, at the bottom.
<?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/Sun" Model="Process" Space="CMYK" ColorValue="0 15 90 0" ColorOverride="Normal" Name="Sun" ColorEditable="true" ColorRemovable="true" Visible="true"/>
<Color Self="Color/Sky" Model="Process" Space="CMYK" ColorValue="70 25 0 0" ColorOverride="Normal" Name="Sky" ColorEditable="true" ColorRemovable="true" Visible="true"/>
<Gradient Self="Gradient/SkySun" Type="Linear" Name="Sky to Sun" ColorEditable="true" ColorRemovable="true" Visible="true">
<GradientStop Self="Gradient/SkySun/stop0" StopColor="Color/Sun" Location="0" Midpoint="50"/>
<GradientStop Self="Gradient/SkySun/stop1" StopColor="Color/Sky" Location="100" Midpoint="50"/>
</Gradient>
</idPkg:Graphic>
In Paged: linear and radial gradients render as InDesign places them, measured against its output.
GradientFillAngleturns counter-clockwise, so the example above has Sun at the bottom; a linear gradient starts at itsGradientFillStartand a radial one is centred there; a stop'sMidpointbends the blend before that stop. CMYK stops are blended in CMYK before conversion to the screen. On an anchored frame only the angle is read, not the start or the length. Supported · verified
Named tints: the <Tint> element
A named tint is a swatch of its own: "Vermilion 40 %" in the Swatches panel. IDML writes it
as a <Tint> element in Graphic.xml, beside the colours:
BaseColornames the colour it is a tint of.TintValueis the strength in percent.SelfandNamework as on a<Color>; page items name the tint by itsSelf.Model,SpaceandColorValueare present too and repeat the base colour's values, not the tinted ones. Take the colour fromBaseColorand scale it byTintValue.
A tint of a spot colour stays a tint of that ink: it prints on the spot colour's plate at the given percentage. None of the 305 surveyed documents uses a named tint, so the example below is the reference for the spelling.
Three rectangles: the base colour at full strength; the named tint "Vermilion 40%"; and the base colour with FillTint="40". In InDesign the second and third look the same.
<?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/Vermilion" Model="Process" Space="CMYK" ColorValue="0 85 90 5" ColorOverride="Normal" Name="Vermilion" ColorEditable="true" ColorRemovable="true" Visible="true"/>
<Tint Self="Color/Vermilion40" Model="Process" Space="CMYK" ColorValue="0 85 90 5" Name="Vermilion 40%" TintValue="40" BaseColor="Color/Vermilion"/>
</idPkg:Graphic>
A tint is not transparency. Forty percent of an ink is a lighter colour that still covers what lies beneath it; transparency is set separately, with opacity.
Per-use tints: FillTint and StrokeTint
Any painted object can carry its own tint:
| Attribute · Rectangle | Values | Seen in |
|---|---|---|
| FillTint | number (percent) | 7% |
| StrokeTint | integer | 3% |
FillTint="40" shows the fill colour at 40 % on this object only. The same spellings appear
on text (CharacterStyleRange, character and paragraph styles) and on table cells.
FillTint="-1" is the sentinel for "no tint of its own": the swatch is used as it is, the
same as writing no FillTint at all. InDesign writes -1 often, so a reader must not take
it as a negative percentage. Values from 0 to 100 are a tint; 100 is full strength.
In Paged: named
Supported · verified Supported · verified<Tint>swatches are read, including tints of spot colours, which keep their spot ink.FillTint="-1"is treated as no tint. When the document's CMYK profile is available, aFillTintscales the colour's inks and then goes through the profile, exactly as a named tint does, so the two spellings show alike, as in InDesign; without a profile they take simpler conversions and can differ. AFillTinton an object that applies a<Tint>swatch is taken against the swatch's base colour, not compounded with it. A shape's ownStrokeTintis not read yet, so its stroke paints at full strength.
Frequently asked questions
Where do a gradient's colours come from?
From its <GradientStop> children. Each names a colour in the palette by StopColor; the
gradient has no colour of its own.
Which way does a 90° gradient run? From bottom to top. The angle turns counter-clockwise from left-to-right, so at 90° the first stop is at the bottom of the shape.
Which segment does a stop's Midpoint belong to?
The one between the previous stop and this stop. The first stop has no such segment, and
InDesign writes 50 on it.
How do I write a named tint?
As a <Tint> element with BaseColor naming the colour and TintValue the percentage. A
TintValue attribute on a <Color> is ignored by InDesign.
What does FillTint="-1" mean?
No tint of its own: use the swatch at the strength it defines. It is equivalent to leaving
FillTint out.
Is a 50 % tint the same as 50 % opacity? No. A tint is a lighter colour that still covers what is beneath it; opacity lets the background show through.
Colors & swatches
The IDML Color and Swatch elements, the Model, Space and ColorValue spellings InDesign writes, and the reserved swatches every document carries.
Spot & process color
Process and spot colours in IDML, how a spot ink is previewed through its alternate, mixed inks, overprint and colour groups.