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.
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 | Paged | paged.set |
|---|---|---|---|
| Name | text | read · written | name |
| Self | Gradient reference | read · written | |
| Type | Linear | Radial | read · written | kind |
| ColorEditable | true | not read | |
| ColorRemovable | true | not read | |
| SwatchCreatorID | integer | not read | |
| Visible | false | true | not read | |
| SwatchColorGroupReference | text | not read |
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 | Paged | paged.set |
|---|---|---|---|
| Location | integer / real | read · written | |
| StopColor | Color reference | read · written | |
| Midpoint | integer / real | read · written | |
| Self | text | not read |
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 | Paged | paged.set |
|---|---|---|---|
| GradientFillAngle | number (degrees) | read · written | frameGradientFillAngle |
| GradientFillStart | number-list | read · written | |
| GradientFillLength | length (pt) | read · written | frameGradientFillLength |
| GradientFillHiliteAngle | integer / real | not read | |
| GradientFillHiliteLength | integer / real | not read |
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.
In Paged: linear and radial gradients render, and a radial gradient is centred at its
Supported · verifiedGradientFillStart. Midpoints are honoured, but Paged applies a stop'sMidpointto the blend that follows the stop, not to the one before it. Paged also measuresGradientFillAngleclockwise, 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.
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.
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 | Paged | paged.set |
|---|---|---|---|
| FillTint | number (percent) | read · written | frameFillTint |
| StrokeTint | integer | not read |
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. On a process colour, aFillTintcurrently previews lighter than the same percentage as a named tint, where InDesign shows both alike; this is a known engine issue.
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.