Create long-shadow icons for Flat Designs in Inkscape

Introduction

Flat Design has been the big development to emerge in the web design world this year. Block colours, clean designs, line icons, geometric representations for UI elements, plenty of white-space, all of these have become synonymous with Flat Design, and designers everywhere have tried their hand at producing iconsets.

Early adopters went for the outright 'flat' sentiment in its purest form: no gradients or textures anywhere. But one of the natural evolutions of this seismic shift in design preference was to soften the harsh lines of icons' edges; lessening the severity of those block colours and geometrically-constrained elements. One of the leading examples of this is the so-called "long-shadow" variation, which is a 'flat' icon with an extended drop shadow much longer than conventionally thought of as 'normal'.

This tutorial is based around having a single icon image over a frame, both with long-shadows applied. That's kind of the 'worst' case scenario in terms of work, so hopefully any ideas of your own you go on to produce should be no more complicated than this.

Skills you'll develop in this tutorial

Considerations for successful, professional icon design

Creating a simple icon design and applying long-shadow effects in a systematic way

Using clipping masks to constrain effects within a specified area

Here's the icon we'll be creating in this tutorial, which you'll be able to produce by the end.

Step 1 - Create your icon's basic elements

Create a new Inkscape document and in the Document Properties dialog box, which you can open with Ctrl, Shift and D or via File --> Document Properties, set a document size of 200 pixels square.

Switch on Inkscape's grid using the # key - the default grid settings will be fine - then grab your Rectangle tool using the R key, or find its icon in the toolbox. Use it to draw a rectangle which is 60 pixels square, which you can gauge using the toolbar at the bottom of Inkscape's application window.

Open up the Fill and Stroke panel with Ctrl, Shift and F, set a fill colour for your square of #4bbbdb, and remove any stroke that may be on the shape.

So with our icon's base ready, let's get onto creating the identifying image itself. To allow ourselves the maximum flexibility later, we'll do this on a separate layer above the current one. Open the Layers dialog box with Ctrl, Shift and L and add a new layer using the + button. Alternatively, press Ctrl, Shift and N or go to Layer --> Add Layer in the menus.

Time to draw our icon, then. Switch to Inkscape's Pen Tool with B on the keyboard, and click on a series of points which will be the outline of our mountain icon.

Switch to the Node Tool (keyboard F2) and start moulding this mountain shape to be something a bit more like the well known Inkscape mountain with an inky base. There's plenty of scope for individuality here, of course, but I'll show you how I went about it.

The Node Tool is really powerful: you can re-shape any element on your canvas either by click-and-drag actions, or by selecting individual parts of it - including nodes of course - and using other options to alter them. By the way, you can also hold the Ctrl key down when you click on a node to cycle through the different types, which is often a quick way of converting corner nodes to smooth ones, and so on.

Once you're happy with your mountain shape, change its fill to black. Leave the stroke on the path for now.

Step 2 - Add detail to your icon design

Press Ctrl and D to create a duplicate of this shape, and change its fill to white. Then remove the stroke from this shape.

It's useful to switch off the grid at this point, so we can be a bit more free-form with our shape-building, so hit the hash key #.

Activate your Pen Tool once more and draw a squiggly line that cuts across the mountain, somewhere around halfway. Click and drag each point so that they become curves this time rather than sharp corners. Once your curve is outside the shape, keep clicking to close a looped shape that goes around the top of the icon underneath it.

Activate Inkscape's Select Tool with F1 and hold down the Shift key while you click on the duplicate mountain shape. This should leave you with two objects selected at once. Then select Path --> Intersection or press Ctrl and * to make Inkscape produce a shape from the two overlapping segments.

Now, I should've spotted it earlier, but I notice at this point that our original shape has got a mitred corner on it which is preventing it from looking smooth. As well as looking a bit ugly, it might cause us problems later, so let's fix it now by putting a setting of Rounded on the Stroke Style tab's control. Select the base shape again with the Select Tool and click that middle button on the Fill and Stroke panel. That way it will apply the setting to all this shape's corners, which is handy.

Step 3 - Create an angled shadow for the icon

Keep this shape selected and make a duplicate of it like we did before with Ctrl and D. Then open up the Transform dialog box - Ctrl, Shift and M - or use Object --> Transform. On the Move tab, enter values of 30 for Horizontal and -30 for Vertical, tick Relative Move and click Apply to shift the top copy right and down by 30 pixels.

Now to create the shadow itself. Hold down the Shift key and select the original mountain shape again so that it and your offset copy are both highlighted. From the menus, select Extensions --> Generate from Path --> Interpolate and enter these settings: Exponent should be 1, set Interpolation steps to 200 and Interpolation Method should be 1. Leave the check boxes unticked. Click Apply when you're done.

This will create a group which consists of 200 copies of our object, positioned from the start to end points. You can see this by selecting it and glancing at the infobar again.

We need to turn this group of copies into something we can easily use. So break this group up with Ctrl, Shift and G (or Object --> Ungroup), then unite them into a single object with Ctrl and + or Path --> Union. Because of the shape of the mountain's peak, the result will have a ton of non-critical nodes, so simplify (Ctrl and L or Path --> Simplify) the path to reduce this number, without ruining the shape's outline. I can get away with doing this twice on the same object to reduce the node count from 762 to just 12.

It's worth noting that, depending on the shape you're using for interpolation, you may need many more or less than 200 steps to get a smooth result. It's often trial and error to get it right, but the process is still the same.

Now to change this shape's fill to a shadow gradient using the Fill and Stroke panel. Select the third icon from the left to add a linear gradient from black to transparent, which will reveal some other work we need to tidy up before moving on: it looks like we've got a spare mountain object from before the interpolation, and we need to remove the stroke from the shadow shape. Click on the shadow area once and push it down one level with the Page Down key or Object --> Lower, then select and delete the spare mountain shape.

Lovely. Next, activate the Gradient Tool with Ctrl and F1 and click on the shadow shape. Notice the gradient's start and end points are on the left and right edges of the bounding box. Really, we want the gradient to go in the same direction as the shape: at 45° downwards. Click and drag a gradient in this direction while holding down the Ctrl key, which will lock the angle to 15° increments and make your life easier.

Push this gradient behind the main icon shapes by pressing the End key or by using Object --> Lower to Bottom. Then reduce its opacity to around 15% to make the effect much more subtle.

Step 4 - Use Clipping to remove undesirable overhangs

At this point, you may be aware that we need to take care of the edges of the shadow which extend beyond the limit of the icon's base and overlap the background, as it should reach the edge of the square frame but not go beyond it. How strong the impact is depends how your gradient has come out, but if I put this icon against a differently-coloured background, you should be able to see what I'm talking about.

We can achieve this by using the icon base shape as a Clipping Mask. To make it, select the round-edged square, duplicate it, then press Shift and Page Up (menu option: Layer --> Move Selection To Layer Above) to move the duplicate onto the same layer as the rest of the icon details. Then press the Home key or select Object --> Raise to Top to shove it to the top of the stack of items on this layer.

Next, select all the objects on this layer with Ctrl and A, and select Object --> Clip --> Set. This will perform a 'cookie cutter' operation on all the shapes (using the topmost one as the cutter) and confining the shadow within that border. Be aware that clipping effects all objects within the selection, even if they're on different layers, so watch out if you drag a selection area around your shapes - you'll want to lock the bottom layer first so that nothing there is affected.

Step 4 - (Optional) Add a long-shadow effect to the icon base

If you want to add a similar long-shadow to the base square, simply switch to the base's layer and repeat the steps above to do it. Important - the Interpolate function only works on objects which are Paths, so convert any Rectangles, Circles, Stars, or other standard objects to Paths first. Do this by using Ctrl, Shift and C or Path --> Object to Path.

And using this systematic approach, you can create a whole suite of icons with a consistent set of long-shadows. The shadow's angle remains the same in each case, and because the base is on a separate layer, it's easy to copy, paste and alter it without it ever floating over the top of any of the detail items you create.

So now you know how to reproduce this popular icon style using our free and Open Source vector-creating friend, Inkscape. Have you enjoyed this tutorial? Or produced your own set of Flat Design, long-shadow icons after following these tips? Let me know in the comments section below.

Mark is the Editor and owner of Designmark Graphics Ltd. Publishing tutorial articles and guides for Inkscape and the GIMP, this blog aims to boost the profile of these Open Source graphics applications and showcase what they are capable of.

Please enable JavaScript to view the comments powered by Disqus.

Disqus