whoami
Lucas Jenß
cat /etc/motd
The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.
ls -la ~/languages/
- drwxr-xr-x
- ▶ PHP
- ▶ Ruby
- ▶ Scala
- ▶ C#
- ▶ JavaScript
- ▶ Objective-C
- ▶ Shell Scripting
ls -la ~/toolchain/
- drwxr-xr-x
- ▶ Typo3
- ▶ Akka
- ▶ Capistrano
- ▶ Git
- ▶ MAMP
- ▶ Adobe Illustrator
- ▶ NSTrackingArea (Cocoa)
uname -a
- drwxr-xr-x
- ▶ Mac OS X
- ▶ Unix
Building complex SVG gradients with Illustrator's blend tool
SVG has long offered linearGradient and radialGradient, but anything more ambitious—mesh-like fades, banded colour transitions, soft halos—meant rasterising the artwork or hand-coding endless stop elements. The blend tool in Illustrator is the fastest way to fake those effects, and once you learn the export quirks, the results slot straight into a webpage.
Designers in Sydney, Melbourne, and Brisbane tend to hit this problem more than colleagues in markets where high-fidelity tools ship with mesh-gradient exports. Australia's startup scene—Canva in Surry Hills, Atlassian's design team in Sydney, the agencies around Cremorne and Collingwood—has carved out its own pipelines for shipping vector art to the web. Knowing how to coax a blend into a clean, lightweight SVG file is a quietly useful skill for anyone shipping marketing pages, hero illustrations, or interactive prototypes.
The technique isn't a hack so much as a way of avoiding Photoshop-grade complexity. If you've ever tried to recreate a multi-stop gradient in pure code, you'll know the pain of tweaking each percentage by trial and error. Illustrator's blend takes care of the in-between states, leaving you with a curve that can be exported, simplified, and animated.
Why blend beats hand-coded gradient stops
A single linearGradient with two or three stops is trivial, but the moment you need a soft pastel fade that loops through three different hues, you're looking at defining eight or ten stops with carefully placed offset values. Adjust one colour and the whole stack needs re-tuning. Even seasoned front-end developers end up fighting the spec rather than designing.
A blend, by contrast, lets you draw the start and end shapes with the colours you want, then asks Illustrator to interpolate the steps between them. The result is a path that visually behaves like a gradient but is built from real vector geometry. The exported SVG contains individual paths or a single merged path depending on the option you choose. You can pick the number of steps, the smoothness, and the colour transition curve without touching a text editor.
What makes the technique sing is colour control. Set the start shape to a deep navy and the end shape to a coral pink, pick Specified Steps from the blend options, and dial in 24 steps. Illustrator generates twenty-four intermediate shapes, each with its colour smoothly blended from one end to the other. It is, in effect, a gradient sampled at high resolution—but because it lives as geometry, you can drop it into a CSS clip-path, animate individual slices, or wrap it around a curved surface.
Drawing the source shapes that drive the blend
Begin with two filled shapes of the same type. Rectangles work well for linear effects; ellipses for radial halos; paths with the same number of anchor points for organic mesh-style transitions. The colours you assign to these source shapes dictate the gradient's bookends, so spend time getting the start and end hues right before generating any in-between states.
A practical workflow for a Sydney SaaS hero illustration: place a rectangle at the top of the artboard filled with a desaturated blue (#3B5B8C, familiar to anyone who has seen the palette of countless fintech brands around the CBD), then add a second rectangle at the bottom filled with a warm cream (#F4E3CE). Both shapes need to share the same number of sides and fill type, with matching stroke settings if you want a clean export.
Once both source shapes are ready, select them, head to Object > Blend > Make, and then open Object > Blend > Blend Options. Switch from Smooth Color to Specified Steps for predictable, controllable output, and set the step count to whatever your artboard can stomach. 32 steps reads smoothly for a wide hero banner; 12 is plenty for a small icon. Designers in Melbourne's co-working spaces often have pet rules for this—some go with 16 across the board, others calculate step count based on the final render width in pixels.
Refining the blend before export
A common snag is that Illustrator's blend interpolates the path geometry as well as the colour. If your source shapes have different anchor counts or different rotation, the in-between shapes can twist and fold in ways that ruin the gradient effect. The fix is to give both source shapes identical anchor counts and align them so the corresponding points are roughly parallel.
After the blend is generated, the object behaves like a regular vector group. You can move, scale, and rotate the whole blend as a single unit, and the gradient effect moves with it. To adjust the colour flow, edit the source shapes' fill colours—Illustrator does not automatically re-blend, so you'll need to release the blend, update the colours, and re-make it. Anyone who has fought a stubborn blend knows the ritual; it is a fair dinkum rite of passage for any Aussie illustrator.
A neat trick for adding a third colour to a blend that officially only supports two endpoints is to use the Reverse Spine option combined with a third shape acting as a midpoint. Place a small shape with the third colour between the two main ones, set all three to blend, and then experiment with the spacing. It takes patience, but the result is a smoother transition than hand-stacking multiple linear gradients in SVG and trying to match their stop positions visually.
Exporting the SVG and cleaning the markup
When you save the file as SVG, head to File > Save As, choose SVG, and click the SVG Code button rather than SVG to see the raw markup. The output looks like a series of path elements, one per blend step, each with its own fill. For a typical 24-step gradient that's already 24 paths; for a more complex mesh it can balloon past a hundred.
At this point, a few practical cleanup steps pay off:
- Group the paths with a g element and assign a class name so the whole gradient is targetable from CSS.
- Apply a single fill via CSS and use opacity ramps if your tooling supports it, or keep the individual fills and use a parent transform.
- Strip any Illustrator-specific comments and the XML declaration if your build pipeline already adds one.
- Run the file through SVGO with its default preset to merge identical path attributes and drop empty groups.
For projects that need even more aggressive minification, you can convert the blend into a raster and embed it as a base64 image, but that defeats most of the reason for using SVG in the first place. Stick with the vector output whenever the file is small enough and the design needs to scale.
Performance, accessibility, and what to watch for
Blends with many steps can be heavy on browsers, especially on lower-end Android devices. A 64-step gradient rendered on a full-width hero over a 4G connection in regional Western Australia is a different beast from the same gradient loaded on a Sydney office's NBN line. Profile before you ship, and consider switching to a JPEG or WebP for static sections that don't need to scale.
Accessibility is another angle. Screen readers ignore SVG paths by default, so a gradient used purely for decoration should sit behind a meaningful heading or carry an img alternative. If the gradient conveys information—such as a heatmap or a status indicator—you'll need to layer real text on top, since the in-between path geometry is invisible to assistive tech. The pattern is well documented in Mike Patt's accessibility writing, which is worth a read before publishing any non-trivial SVG.
Performance-minded developers can keep a few habits in mind:
- Test on a mid-range Android handset, not the developer's iPhone.
- Cap step count at 32 for full-width heroes, 16 for smaller panels.
- Use a CSS clip-path with a single gradient definition when mesh-style transitions aren't essential.
- Lazy-load any blend-heavy SVG below the fold so the main thread isn't blocked on first paint.
Finally, blend-generated SVG paths do not animate gracefully. Each path is its own DOM element, and animating them with SMIL or CSS can flicker as the browser re-composites the layers. If you need motion, keep the blend as a static export and animate a separate, simpler mask on top. That approach has served me well on projects where the marketing team wanted subtle movement on hero artwork without bloating render times.
If you want to see the technique in action, the working files and a video walkthrough are tucked into the coding journal archive alongside related Illustrator-to-SVG notes. Have a go, drop the result into a CodePen, and you'll quickly get a feel for how step count, source shape alignment, and file size trade off. Once dialled in, the blend tool becomes one of those quietly indispensable parts of a vector workflow—you'll reach for it every time a client asks for a "subtle background gradient" that turns out to be anything but.
cat ~/interests.json
| Key | Value |
|---|---|
| editor | Terminal-first workflow |
| os | Mac OS X / Unix |
| vcs | Git, distributed version control |
| deploy | Capistrano, cron automation |
| graphics | SVG, Adobe Illustrator troubleshooting |
| networking | IP validation, SSH, VPN |
git log --oneline --reverse
Solving SVG import issues in Adobe Illustrator CS6 and CC
When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.
Solving NDK build issues on OS X
Troubleshooting native development kit compilation problems on Mac OS X.
Programmatically adding PHP generated TypoScript to the backend configuration
Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.
ArgumentError: Could not parse PKey: no start line
Debugging an SSH key parsing error encountered during deployment.
Validating IP-Addresses in PHP
Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.
Cocoa: Using NSTrackingArea
A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.
cat ~/contact.txt