Long Shadow for Affinity
dailyRushes Scripts for Affinity
dR Long Shadow adds sharp, geometric long shadows to text, shapes and curves: the flat-icon look, built from real vector shapes. Text stays editable, and any shadow can be reopened and changed later.
Making a shadow
- Select the object.
- In the Script Library, click dR Long Shadow. The shadow previews live as you go.
- Adjust the settings.
- Click OK to keep it, or Cancel to stop without adding it.
The shadow is a layer called Long Shadow, placed directly behind the object.
Number fields have a small arrow that opens a slider, or you can type a value. Controls that have no effect with the current settings are greyed out.
Several objects at once
They all get the settings you choose, even if they already have shadows with different settings.
What the preview shows
The live preview shows the plain shadow. Clipping, hole cut-outs, the walls inside holes and step outlines are added when you click OK, and the window says which. With very fine steps on large objects the preview pauses. Click OK and the full shadow is built, which may take a while.
Reset to defaults
A new shadow starts from the settings of the last one you made in the document. Reset to defaults, at the top of the window, starts fresh. Your last settings are remembered within a document only, because Affinity gives scripts nowhere to store settings between documents.
Changing a shadow
Edit it
Select the object, or its shadow, and run dR Long Shadow again. The window opens with that shadow’s settings. Click OK to replace it.
Remove it
Delete its Long Shadow layer. Making a shadow takes several undo steps, so deleting the layer is quicker than undoing.
After changing the object
Shadows don’t follow edits by themselves. See Update All.
Good to know
- Keep each shadow directly below its object in the Layers panel. Object and shadow are also linked behind the scenes, so moving them around the page together is fine.
- A copied Long Shadow layer loses its link. Running the script on the object replaces the copy rather than adding a second shadow. Any layer called “Long Shadow” directly below the object counts as a copy, so the window says when one will be replaced, and Cancel keeps it.
- Hidden layers can’t catch a shadow, and hidden layers inside a group don’t cast one.
- Stroked shapes cast a shadow from their path, not the stroke’s width.
- An open line casts its shadow as if its ends were joined.
- Lengths and step sizes are in pixels, whatever units the document uses.
If something looks wrong
| What you see | Fix |
|---|---|
| “Select the text, shapes or curves to give a long shadow” | Nothing was selected. Select an object, then run the script again. |
| “Nothing in the selection has an outline to extrude” | The selection has no shape to cast a shadow, such as a group with only hidden layers. |
| Clip to is greyed out | There is no visible layer under the object in the same layer or group. |
| Holes is greyed out | Nothing selected has a hole, or you are using Keep edge colours, which always shows the real inside of a hole. |
| A white object has a grey shadow | With Colour from set to Object, Shade % at -30 gives light grey. Use 0 for a white shadow. |
| The window says it is using Colour | There was no colour to read from the object or the surface below, so the Colour you picked is used. |
| The shadow doesn’t match the object after an edit | Shadows don’t follow edits by themselves. Run dR Long Shadow - Update All. |
| Update All left a shadow as it was | It couldn’t find the shadow’s object. Keep each shadow directly below its object. |
| Layer effects on a shadow are gone after a rebuild | Effects can’t be carried over. Add them after your last update. |
These controls set the shadow’s direction and size, what happens at holes, and what the shadow is allowed to fall on.
Shadow controls
Angle (clockwise)
The direction of the shadow: 0 points right, 90 down and 45 down-right. The default is 45.
Length
How far the shadow reaches, from 1 to 2000 pixels. The default is 300.
End size %
The size of the far end, from 5 to 300. The default is 100, which keeps the shadow parallel. Lower tapers it to a point, and higher widens it like a beam.
Holes
What happens where the object has holes, such as the pin of a map icon or the counter of an O:
- Fill: holes fill with shadow. This is the default.
- Light through: light passes through the hole and leaves a patch of light in the shadow. The patch shrinks as the shadow gets longer.
- Beam: the hole’s shape runs the full length of the shadow, cutting a channel of light through it.
It is greyed out if nothing selected has a hole, and with Keep edge colours, which always shows the real inside of a hole.
Clipping
Clip to
What the shadow is allowed to fall on:
- None: no clipping. This is the default.
- Shape below: only the layer directly under the object.
- All surfaces below: every visible layer under the object that the shadow overlaps.
Only layers next to the object count: those in the same layer or group. It is greyed out if there are none.
Show inner walls through holes
Used with clipping on, and ticked by default. Ticked, the dark inside wall always shows through a hole, even where the hole hangs past the edge of the surfaces. Unticked, the shadow follows the surfaces’ edges only.
Shadow from object
Used with clipping on, and unticked by default. Ticked, any part of the object that hangs past the edge of the surfaces below casts its shadow freely, as if nothing were there to stop it, and the rest of the shadow still clips to the surfaces. Unticked, the whole shadow clips to the surfaces’ edges.
Icons: clipping to a tile
Typical layers, from bottom to top, are tile, map and pin.
- Select the pin.
- Set Clip to to All surfaces below.
The shadow falls across the map, carries on over the tile and stops at the tile’s edge, while staying above the map so it darkens it. With the tile hidden or absent, the shadow ends at the map’s edge instead.
These controls set where the shadow’s colour comes from, how gradients carry into it, and how it blends along its length.
Colour controls
Colour from
Where the shadow’s colour comes from:
- Custom: the Colour you pick. This is the default.
- Object: the object’s own fill colours, not its stroke. Each part of the object gives its own shadow, so a word that is half white and half purple casts a white shadow and a purple one.
- Surface below: the colour of the layer the object sits on. A gradient counts as its average colour.
If there is no colour to read, the window says so and Colour is used instead.
Colour
The shadow colour, for Custom. Lower its opacity to let the surfaces show through.
Shade % (- darker, + lighter)
For Object and Surface below, from -100 to 100. The default is -30. Below 0 darkens the colour, above 0 lightens it, and 0 keeps it exact. White at -30 gives light grey, so use 0 for a white shadow.
Opacity %
For Object and Surface below: how solid the shadow is, from 0 to 100. The default is 100.
Object gradients
Object gradient
When the object has a gradient fill:
- Keep edge colours: each side of the shadow keeps the colour of the edge it comes from, all the way along, for a solid 3D extrusion look. Holes show their inner walls. This is the default.
- Graduate along shadow: the gradient runs from the object to the far end. With Steps on, each step takes the next colour from it.
- Continue into shadow: the gradient carries on into the shadow just as it sits on the object.
Reverse gradient
Flips the object’s gradient end to end before the shadow uses it. It works with all three choices above.
Blends
Blend to end colour
Blends from Colour to End colour: one smooth gradient with Steps off, or a shade per step with Steps on. With Object or Surface below colour, it fades the shadow out to transparent instead.
End colour
The far-end colour for Custom. Opacity 0 gives a fade.
Gradient follows shadow angle
For Blend to end colour and Graduate along shadow, with Steps off. It is ticked by default, and the gradient runs in the same direction as the shadow. Untick it to set your own direction with Gradient angle.
Gradient angle
From 0 to 360, clockwise, like Angle: 0 runs the gradient left to right, and 90 top to bottom. The gradient still spans the whole shadow from start to end colour.
Steps cut the shadow into bands, and can draw a line around each one. They work with every colour choice, including Keep edge colours.
Steps controls
Steps
Cuts the shadow into bands. It is off by default.
Step every
The band size, from 1 to 500 pixels. The default is 50. It is rounded so a whole number of bands fits the Length, up to 200 bands.
Outline steps
Draws a line around each band. It is ticked by default. The outlines are added when you click OK, so the preview doesn’t show them.
Outline weight
From 0 to 20 pixels. The default is 2.
Outline colour
The line colour.
dR Long Shadow - Update All rebuilds every shadow on the current page from its object, keeping each one’s settings.
When to run it
Shadows don’t follow edits by themselves. Run it after you:
- edit text;
- move objects;
- recolour an object, because it reads the object’s colours again;
- show, hide or reshape the layers a shadow is clipped to.
Running it
- In the Script Library, click dR Long Shadow - Update All. Nothing needs to be selected.
- The window says how many shadows it found on the page. Click OK to rebuild them, or Cancel to stop.
Run it once per page on multi-page documents.
What it keeps
- Each shadow’s settings.
- Changes in the Layers panel. If you hid a shadow, or changed its blend mode or opacity, that is kept too.
Layer effects added to a shadow are not kept, because scripts can’t read them. Add those after your last update.
If it can’t find an object
Shadows whose object it can’t find are left as they are, and it tells you how many. Keep each shadow directly below its object in the Layers panel.