paged.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

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 · GradientValuesPagedpaged.set
Nametextread · writtenname
SelfGradient referenceread · written
TypeLinear | Radialread · writtenkind
ColorEditabletruenot read
ColorRemovabletruenot read
SwatchCreatorIDintegernot read
Visiblefalse | truenot read
SwatchColorGroupReferencetextnot read
The 8 attributes real documents use most. All 8 attributes of Gradient →

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 · GradientStopValuesPagedpaged.set
Locationinteger / realread · written
StopColorColor referenceread · written
Midpointinteger / realread · written
Selftextnot read
The 4 attributes real documents use most. All 4 attributes of GradientStop →
  • 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 · RectangleValuesPagedpaged.set
GradientFillAnglenumber (degrees)read · writtenframeGradientFillAngle
GradientFillStartnumber-listread · written
GradientFillLengthlength (pt)read · writtenframeGradientFillLength
GradientFillHiliteAngleinteger / realnot read
GradientFillHiliteLengthinteger / realnot read
Selected attributes. All 55 attributes of Rectangle →
  • 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.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/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, and a radial gradient is centred at its GradientFillStart. Midpoints are honoured, but Paged applies a stop's Midpoint to the blend that follows the stop, not to the one before it. Paged also measures GradientFillAngle clockwise, so a 90° gradient runs from top to bottom with the first stop at the top: the example above renders upside down compared with InDesign. Both are known engine issues. CMYK stops are blended in CMYK before conversion to the screen.

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.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/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 · RectangleValuesPagedpaged.set
FillTintnumber (percent)read · writtenframeFillTint
StrokeTintintegernot read
Selected attributes. All 55 attributes of Rectangle →

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. On a process colour, a FillTint currently previews lighter than the same percentage as a named tint, where InDesign shows both alike; this is a known engine issue.

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