How to custom color gradient of highlight mesh effect

https://www.babylonjs-playground.com/#1KUJ0A#1172

How to set the highlight effect like this?

As long as your shape has smooth edges you can use the oultine renderer: https://playground.babylonjs.com/#0YG7IF#50

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