Paged.The open publishing system
The format atlas
Color & swatches

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.

Tier: IntermediateIntermediateIIreference

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 · GradientValuesSeen in
Nametext100%
SelfGradient reference100%
TypeLinear | Radial100%
ColorEditabletrue100%
ColorRemovabletrue100%
SwatchCreatorIDinteger100%
Visiblefalse | true100%
SwatchColorGroupReferencetext97%
The 8 attributes real documents use most. Seen in: the share of documents with a Gradient that set it. All 8 attributes of Gradient; what Paged reads, edits and writes is in its Paged support panel.

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 · GradientStopValuesSeen in
Locationinteger / real100%
StopColorColor reference100%
Midpointinteger / real100%
Selftext100%
The 4 attributes real documents use most. Seen in: the share of documents with a GradientStop that set it. All 4 attributes of GradientStop; what Paged reads, edits and writes is in its Paged support panel.
  • StopColor names a colour in the palette by Self id. A stop has no colour of its own, so editing the colour changes every gradient that uses it.
  • Location is the stop's position along the gradient, in percent from 0 to 100.
  • Midpoint is where the blend between the previous stop and this one reaches its halfway colour, in percent of the distance between them. 50 is an even blend. The first stop has nothing before it; InDesign writes 50 there. 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 · RectangleValuesSeen in
GradientFillAnglenumber (degrees)93%
GradientFillStartlist (pt)93%
GradientFillLengthlength (pt)93%
GradientFillHiliteAngleinteger / real93%
GradientFillHiliteLengthinteger / real93%
Selected attributes. Seen in: the share of documents with a Rectangle that set it. All 55 attributes of Rectangle; what Paged reads, edits and writes is in its Paged support panel.
  • 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.
  • GradientFillStart and GradientFillLength give 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.
  • GradientFillHiliteAngle and GradientFillHiliteLength are 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.

Resources/Graphic.xmlRead / the source
<?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. GradientFillAngle turns counter-clockwise, so the example above has Sun at the bottom; a linear gradient starts at its GradientFillStart and a radial one is centred there; a stop's Midpoint bends 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:

  • BaseColor names the colour it is a tint of.
  • TintValue is the strength in percent.
  • Self and Name work as on a <Color>; page items name the tint by its Self.
  • Model, Space and ColorValue are present too and repeat the base colour's values, not the tinted ones. Take the colour from BaseColor and scale it by TintValue.

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.

Resources/Graphic.xmlRead / the source
<?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 · RectangleValuesSeen in
FillTintnumber (percent)7%
StrokeTintinteger3%
Selected attributes. Seen in: the share of documents with a Rectangle that set it. All 55 attributes of Rectangle; what Paged reads, edits and writes is in its Paged support panel.

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 <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, a FillTint scales 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. A FillTint on an object that applies a <Tint> swatch is taken against the swatch's base colour, not compounded with it. A shape's own StrokeTint is not read yet, so its stroke paints at full strength.

Supported · verified Supported · verified

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.

On this page