How to custom color gradient of highlight mesh effect

How to set the highlight effect like this?

As long as your shape has smooth edges you can use the oultine renderer:

The smooth edge problem is described here: Render Outline - Buggy - #13 by Evgeni_Popov

With the solution to smooth them here :Weird effect when applying overlayColor - #7 by bartbutenaers